0

プロジェクトでスライド メニューを個別に使用し、タブを個別に使用しましたが、それらを 1 つのプロジェクトに結合できませんでした。この問題に直面した人はいますか? 前もって感謝します

4

2 に答える 2

0

スライドメニューでタブを使用できます。スライド メニューの 2 番目の子にタブを含むレイアウトを配置する必要があります。

<android.support.v4.widget.SlidingPaneLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<RelativeLayout
    android:id="@+id/drawer_relative"
    android:layout_width="280dp"
    android:layout_height="match_parent"
    android:layout_gravity="left" >

    <FrameLayout
        android:id="@+id/list_fragment_id"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
    </FrameLayout>
</RelativeLayout>

<android.support.v4.app.FragmentTabHost
    android:id="@android:id/tabhost"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_weight="0" />

        <FrameLayout
            android:id="@+id/realtabcontent"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0"
            android:orientation="horizontal"
            android:showDividers="none" />
    </LinearLayout>
</android.support.v4.app.FragmentTabHost>

于 2014-03-31T07:07:17.957 に答える
0

この素晴らしいクラスを使用するだけです:) http://developer.android.com/samples/SlidingTabsBasic/src/com.example.android.common/view/SlidingTabLayout.html

于 2014-05-22T11:19:05.183 に答える