Вкладки внизу с видом на карту сверху

1

Привет, люди.

Im работает над созданием приложения с tabview, где на одной из вкладок включен mapview. Buut я хочу, чтобы вкладка была внизу, а не сверху, когда я устанавливал силу тяжести или layout_marginBottom в true, она исчезает и больше не видна на экране.

Вот xml файл для активности вида табуляции

<?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:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

        <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" >

            <RelativeLayout
            android:id="@+id/emptylayout1"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="vertical" />

        </FrameLayout>
    </LinearLayout>

</TabHost>

Любые идеи о том, как получить вкладки внизу и все еще видны?

Теги:
tabview
android-mapview

2 ответа

3
Лучший ответ
<?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" 
    android:background="@android:color/white">

    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:padding="5dp" />

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true" />
    </RelativeLayout>

</TabHost>

Это работает для меня. Поместите вкладку FrameLayout над TabWidget. Пожалуйста, попробуйте и дайте мне знать.

  • 0
    Вы geniiiiuuus ..: D Большое спасибо, действительно, это сработало, но у меня есть еще один вопрос, карта не заполняет весь экран, это как белый край ?? в любом случае, чтобы решить эту проблему ??
  • 0
    android: background = "@ android: color / white" может быть причиной появления белого края. Также попробуйте удалить android: padding = "5dp" из FrameLayout.
Показать ещё 5 комментариев
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="match_parent"
    android:layout_height="match_parent" >

    <RelativeLayout
        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="match_parent"
            android:layout_above="@android:id/tabs" />

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true" />
    </RelativeLayout>

</TabHost>

Ещё вопросы

Сообщество Overcoder
Наверх
Меню