0

アプリケーションでタブを作成する必要があります。次の機能を使用しました...しかし、タブがiPhoneを調べているときに表示する必要があります。Android 1.6を使用してどのように可能ですか? 前もって感謝します..

<?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">
<RelativeLayout
    android:layout_height="fill_parent"
    android:layout_width="fill_parent">
    <TabWidget
        android:id="@android:id/tabs"
        android:layout_alignParentBottom="true"
        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"
        android:padding="5dp" />
</RelativeLayout>

これを試しましたが、アプリケーションがクラッシュします

<?xml version="1.0" encoding="utf-8"?>
<TabHost android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@android:id/tabhost"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TabWidget
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@android:id/tabs"
android:layout_alignParentBottom="true"
/>
 <FrameLayout
 android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@android:id/tabcontent"
 >
 </FrameLayout>
</RelativeLayout>
</TabHost>
4

1 に答える 1

1

ここにあるiPhone UITabBarのようにAndroidタブをカスタマイズしました:

または、を使用して独自のタブを実装できますが、このプロジェクトを参照して実装するRadioGroupには、膨大な作業が必要です。それはiPhoneライクな使い方で、iPhoneタブのように自分で使うことができます。RadioGroupSegmentedControl

于 2011-06-07T12:05:47.700 に答える