height - TabHost on Facebook for Android -


anyone know how facebook did this:



alt text



know cannot change height of tabhost. i'm guessing laid "frank cho" view on tabhost give appearance of being shorter may wrong. know what's going on?

you can have custom looking tab widgets. need set tab indicator custom layout (with drawables) , should go.

here's semi-example:

final tabhost host = gettabhost();  final textview indicator = (textview) getlayoutinflater().inflate(                             r.layout.tab_indicator,                             gettabwidget(), false); indicator.settext("tab title");  host.addtab(host.newtabspec("the tab tag")             .setindicator(indicator)             .setcontent([put content here])); } 

where tab_indicator layout can this:

<textview xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/tab_label"     android:layout_width="0dip"     android:layout_height="fill_parent"     android:layout_weight="1"     android:gravity="center"     android:textsize="14sp"     android:textstyle="bold"     android:minheight="38dp"     android:background="@drawable/minitab" /> 

the minitab drawable drawable item selector (so need have image selected, default, pressed, , unselected). facebook app used white drawable image default tab , blue gradient drawable unselected tabs.

check out google io schedule app full working example: http://code.google.com/p/iosched/ (and trackdetailactivity.java)


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -