Margin-problem with changed layout for titlebar

by $搂Kalle搂$ » Thu, 12 Feb 2009 04:11:21 GMT


Sponsored Links
 I am using the following Layout for the titlebar with a blue backround
color

<RelativeLayout
        android:id="@+id/RelativeLayout01"
        xmlns:android=" http://schemas.android.com/apk/res/android" ;
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#ff000099">
        <TextView
                android:id="@+id/TextView01"
                android:layout_height="wrap_content"
                android:text="@string/app_name"
                android:textColor="#ffffffff"
                android:textStyle="bold"
                android:gravity="center_vertical"
                android:layout_centerVertical="true"
                android:layout_width="wrap_content">
        </TextView>
</RelativeLayout>

In onCreate I got:
...
        requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
        setContentView(R.layout.main);
        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,
R.layout.title);
...

With that I get a changed titlebar for my HelloWorlApp, that is fine.
But somehow on the left and right side there is some margin and I
still can see some Grey from the original titlebar.

What did I wrong?

KalLe
--~--~---------~--~----~------------~-------~--~----~



Margin-problem with changed layout for titlebar

by $搂Kalle搂$ » Sat, 14 Feb 2009 17:03:22 GMT


 I uploaded a screenshot, which shows the problem, I have with the
changed titlebar

 http://hphone.eu/Android/Titlebar.html 

KalLe



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Margin-problem with changed layout for titlebar

by $搂Kalle搂$ » Sun, 15 Feb 2009 08:44:40 GMT


 on't worry. I will not try to make my apps like Windows x.x. I just
want to understand the changebale titlebar for the moment ;-)

Here is the complete layout, which fits to the scrrenshot I mentioned.
I do not think, that the icons caused the problem.

######################
<?xml version="1.0" encoding="utf-8" ?>

<RelativeLayout
android:id="@+id/RelativeLayout01"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ff000099">
<TextView
android:id="@+id/TextView01"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:textColor="#ffffffff"
android:textStyle="bold"
android:gravity="center_vertical"
android:layout_centerVertical="true"
android:layout_width="wrap_content" />
<AbsoluteLayout
android:id="@+id/AbsoluteLayout01"
android:layout_width="fill_parent"
android:layout_toRightOf="@+id/TextView01"
android:layout_height="fill_parent">
<LinearLayout android:id="@+id/LinearLayout01"
android:gravity="right"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageButton
android:id="@+id/ImageButton01"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center_vertical"

android:layout_marginRight="20dip"
android:clickable="true"

android:background="@drawable/us" />
<ImageButton
android:id="@+id/ImageButton02"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="center_vertical"

android:layout_marginRight="20dip"
android:clickable="true"

android:background="@drawable/es" />
<ImageButton
android:id="@+id/ImageButton03"

android:layout_width="wrap_content"



Margin-problem with changed layout for titlebar

by elDoudou » Fri, 10 Apr 2009 23:26:17 GMT


 If you take a look at the hierarchy viewer, you will notice that the
customized title is contained in a FrameLayout with id
"title_container", which has a left and right padding set to 7. I
would be you, I'd try something like have a handle on your activity
root view, ask for its parent (a FrameLayout with id "content"), from
there ask this new view parent, i.e. a LinearLayout with no
identifier, and ask this view second child, which is the FrameLayout
responsible for setting the left and right passings: call the
setPadding() method on it, and see what happens.

This is really dirty, and I woul suggest to do as mentionned in the
previous post in your case! That was just meant to say that it might
be possible...

Hope that helps. Regards, douard
--~--~---------~--~----~------------~-------~--~----~



Margin-problem with changed layout for titlebar

by elDoudou » Mon, 13 Apr 2009 17:18:02 GMT


 As you are asking, please read 
 http://developer.android.com/guide/developing/tools/hierarchy-viewer.html 
for the explanations about the hierarchy viewer.
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Radio FM di Cliq

Barusan buka www.modmymoto.com , rupanya hari ini bakalan ada rom baru Handler 
1.4 masih di tulis coming soon, baca change log nya ada FM Radio (beta).

Sebenarnya baca2 sih dah bisa emang fm radionya sekarang, ada tutorialnya jg, 
tapi enakan yg bawaan rom aja deh hehe..

Demikian sekilas info :)


Sent from my BlackBerry

-- 
"Indonesian Android Community [id-android]" 

2. Update application in market

Hello,

I've publish and app in market, but due an  error now I need to
restrict api level to 4+.

Can I update only the manifest.xml ?

It's mandatory increase  both version number  and version name?


All users must to download new version ?


Thank.



-- 

3. where can I get the source code of button

4. Corrupted SQLite database

5. webapps and iframes?

6. Android PDF

7. how to implement progress bar as same as windows loader bar