android - Add custom title bar using ActionBar -


i want add custom title bar in child of fragmentactivity, have layout title bar , how it.

    final actionbar actionbar = getactionbar();      actionbar.setdisplayoptions(actionbar.display_show_custom);     actionbar.setcustomview(r.layout.title_bar);      actionbar.setnavigationmode(actionbar.navigation_mode_tabs);     actionbar.addtab(actionbar.newtab().settext("tab0").settablistener(this));     actionbar.addtab(actionbar.newtab().settext("tab1").settablistener(this));     actionbar.addtab(actionbar.newtab().settext("tab2").settablistener(this)); 

but problem title bar showing below tabs. want title bar above navigation tabs.

this title_bar.xml

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/titlebar"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:background="@color/black" >      <imageview         android:id="@+id/titlebarmenubtn"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:src="@drawable/menu_btn" />       <textview         android:id="@+id/titlebarlocation"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_alignparentright="true"         android:layout_alignparenttop="true"         android:layout_torightof="@+id/titlebarmenubtn"         android:text="location"         android:textcolor="@color/white"         android:textsize="16dip" />       <textview         android:id="@+id/titlebarupdatedate"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_alignbottom="@+id/titlebarmenubtn"         android:layout_alignleft="@+id/titlebarlocation"         android:layout_alignparentright="true"         android:text="updated: 30/jul/2013"         android:textcolor="@color/white" />  </relativelayout> 

i saw this post tabs showing above title bar.

thanks

showing tabs above custom layout intended default behaviour. though there ways override this. found post possible solutions: #1 , #2

further more sherlock actionbar seems behave same way.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -