I want to develop a title bar in android like this
- Home Button - Left aligned
- Application Title - At the center
- Image Icon - Right Aligned
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.
To create a custom title bar, you need to do four things
TextViewfor left, center text, and aImageViewaligned in the centre.onCreateof the activity where the custom title is displayed, callrequestWindowFeature(Window.FEATURE_CUSTOM_TITLE);setContentViewas usual.getWindow.setFeatureInt(Window.FEATURE_CUSTOMER_TITLE, R.layout.my_custom_title);From there onwards, its a matter of obtaining the
TextViewandImageViewwidgets viafindViewByIdand calling the appropriate methods of the widget to suit the requirements.