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. Known apps supporting ACTION_EDIT on image/*?

Does anyone know of any apps that support the ACTION_EDIT intent on image/*?

A little googling shows that this question has been asked a few years
back with no response, so I'm wondering if anyone is aware of anything
new.

Thanks,
Aaron

-- 

2. The proxy URL should be entered without the http://

Hi guys, I had the same problem, but when opened the .android/
androidtools.cfg notices how the http.proxyHost= had to include
backslash for special caracters such as ":", therefore I tried setting
the proxy URL without the http:// from the begging. and it worked.

:D

-- 

3. Problem with padding when loading Nine Patch Drawable

4. animated widget

5. Seng . wants to chat

6. Phone number formating on incoming call, determing country code?

7. Emulator not rotating screen?