Reputation: 41
I want to develop a title bar in android like this
I am not sure how to do it. I am a new user and hence not allowed to post the image here. Sorry for inconvinience.
Upvotes: 0
Views: 2064
Reputation: 3843
There are two way for the change the title bar
1) Normal way,
you can Change the Title of each screen (i.e. Activity) by setting their Android:label
<activity android:name=".Hello_World"
android:label="This is the Hello World Application">
2) if you want to Customize title-bar, i.e. you Want to put Image icon and custom-text, then following this LINK
Upvotes: 0
Reputation: 34592
To create a custom title bar, you need to do four things
TextView
for left, center text, and a ImageView
aligned in the centre.onCreate
of the activity where the custom title is displayed, call requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView
as usual.getWindow.setFeatureInt(Window.FEATURE_CUSTOMER_TITLE, R.layout.my_custom_title);
From there onwards, its a matter of obtaining the TextView
and ImageView
widgets via findViewById
and calling the appropriate methods of the widget to suit the requirements.
Upvotes: 1