android - How to remove icon space from TabView -
i need remove icon space , space between text , top of tab in tabhost? want display text.
this activity_main.xml
`<tabhost android:id="@android:id/tabhost" android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1" > <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <tabwidget android:id="@android:id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content" > </tabwidget> <framelayout android:id="@android:id/tabcontent" android:layout_width="match_parent" android:layout_height="match_parent" > </framelayout> </linearlayout> </tabhost>` this theme.xml
<resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="mytheme" parent="@android:style/theme.holo.light"> <item name="android:actionbarstyle">@style/myactionbar</item> <item name="android:tabwidgetstyle">@style/lighttabwidget</item> </style> <style name="myactionbar" parent="@android:style/widget.holo.light.actionbar"> <item name="android:background">#0767de</item> <item name="android:titletextstyle">@style/myactionbar1</item> </style> <style name="myactionbar1" parent="@android:style/widget.holo.light.actionbar"> <item name="android:textcolor">#ffffff</item> </style> <style name="lighttabwidget" parent="@android:style/widget.tabwidget"> <!-- set textcolor red, can verify applied. --> <item name="android:textcolor">#0767de</item> <item name="android:textsize">14sp</item> <item name="android:tabstripenabled">false</item> </style> this java file
/**tab all**/ intent=new intent(this,tab_all.class); spec=tabhost.newtabspec("first").setindicator((view)findviewbyid(r.id.tab_all)).setcontent(intent); tabhost.addtab(spec); /**tab today**/ intent=new intent(this,tab_today.class); spec=tabhost.newtabspec("second").setindicator((view)findviewbyid(r.id.tab_all)).setcontent(intent); tabhost.addtab(spec); /**tab month**/ intent=new intent(this,tab_thismonth.class); spec=tabhost.newtabspec("third").setindicator((view)findviewbyid(r.id.tab_all)).setcontent(intent); tabhost.addtab(spec); now this.
but need convert this.
thanks in advance.
maybe use:
android:layout_height="wrap_content" replace in tabhost, linearlayout , framelayout!
i think parent's view has larger height, tabhost takes on it's parent's height
android android-tabhost tabwidget
No comments:
Post a Comment