Tuesday, October 12, 2010

[android-developers] Custom title bar with TextView and id @android:id/title does not inherit/use android:label from manifest!

I have a custom title bar that I would like to apply to all my
activities. I have searched online and found a few ways of doing that
however I have ran into a problem.

It seems that despite the fact I have a TextView in my titlebar with
id @android:id/title, Android will not use the value defined in the
manifest in android:label for each activity.

I tried also calling setTitle(R.string.myTitle) but it still will not
render it! If I manually put some text in my TextView in the xml it
shows up fine.

How can I have a custom title bar that is linked and makes Android use
my manifest values for labels? I do not want to lose the setTitle() or
the XML attributes functionality.

Thanks.

p.s I would like to avoid embedding the title as a view in my layout
and use FEATURE_NO_TITLE. I do not want to do that.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate