[英]android: how to add style or background to tabhost and tabs
就像android的聯系人中的標簽一樣,我想添加樣式(或者可能是背景或我不知道的東西)怎么請?
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
</TabHost>
你會告訴我在哪里可以找到好的背景或標簽,因為我不擅長設計:)
在這里,您幾乎可以了解有關該標簽的所有信息。 適用於Android 1.6及更高版本: http : //joshclemm.com/blog/?p=136
您必須在TabSpec上調用setIndicator並將其傳遞給視圖,而不僅僅是文本。 然后,您可以使用選擇器等自定義該視圖。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.