开发者

Android TabWidget default style

开发者 https://www.devze.com 2023-04-03 04:43 出处:网络
I have a problem that sounds like this: I have a TabHost and I want to change it\'s size (height and width) so I used inflate to do this

I have a problem that sounds like this: I have a TabHost and I want to change it's size (height and width) so I used inflate to do this

TextView tabContent = (TextView)getLayoutInflater().inflate(R.layout.tab_content,tab.getTabWidget(),false);

and my开发者_运维知识库 xml:

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tab_label"
android:layout_width="80dp"
android:layout_height="fill_parent"
android:gravity="center"
android:textSize="14sp"
android:background="@color/green"

/>

This is working, but the problem is: How do I inherit the old style of the tab since this is canceling it. I mean i want this to be on the grey background and if i click it, to take focus and be yellow and so on, like the default tabs?

Thanks Arkde


When you coose to customize your tabs, the standard tab behaviour is not accessible anymore.

Here is a very good example about customizing Tabs:

http://joshclemm.com/blog/?p=136

0

精彩评论

暂无评论...
验证码 换一张
取 消