1

Здравствуйте, я начинающий программист и столкнулся с проблемой. Искал ответ в интернете, но так и не нашел. Помогите пожалуйста. Мне нужно сделать чтобы, табы были снизу, а сверху было место для вывода информации.

<?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 xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical" 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <RelativeLayout
            android:id="@+id/welcome"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content">
            <TextView xmlns:android="http://schemas.android.com/apk/res/android"
                android:id="@+id/cc_welcome" 
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" 
                android:text="Welcome"
                android:layout_centerInParent="true"
                android:textColor="#ffffff"/>
        </RelativeLayout>
        <RelativeLayout
            android:layout_below="@id/welcome"
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">
            <TabWidget
                android:id="@android:id/tabs"
                android:layout_alignParentTop="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:layout_below="@android:id/tabs"/>
        </RelativeLayout>
    </RelativeLayout>
</TabHost>

1 ответ 1

2

Я делал так:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.app.FragmentTabHost
        xmlns:android="http://schemas.android.com/apk/res/android"
        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="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:fadingEdge="none"
                android:showDividers="none"
                />

    </LinearLayout>


</android.support.v4.app.FragmentTabHost>

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.