2011-01-23 3 views
0

Итак, у меня есть вкладка с двумя вкладками. Под ними я хотел бы получить второе представление. На данный момент я могу поместить представление в конец, но он все еще перекрывается с тем, что находится в конце текущей видимой вкладки. Кто-нибудь имеет представление о том, как получить второе представление под вкладками, а не перекрывать конец их содержимого?Android: добавление вида под TabActivity

Так, например, если вид просто TextView, мой макет выглядит следующим образом:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 

    <TabHost android:id="@android:id/tabhost" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 

     <LinearLayout android:id="@+id/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> 

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

     <TextView android:id="@+id/EndView" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:text="At the end of the screen"/> 

     </RelativeLayout> 
</RelativeLayout> 

ответ

0

Использование android:below="@id/tabhost":

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
    <TabHost ...> 
     ... 
    </TabHost> 

    <RelativeLayout android:id="@+id/InnerRelativeLayout" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:below="@id/tabhost"><!-- LOOK HERE --> 

     <TextView android:id="@+id/EndView" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:text="At the end of the screen"/> 

     </RelativeLayout> 
</RelativeLayout> 
+0

Для этого я получаю сообщение «Ошибка: Нет Идентификатор ресурса найдено для атрибута «внизу» в пакете «андроид». Вы имеете в виду "android: layout_below =" @ + id/tabhost ""? Если я сделаю это, текстовое окно все еще будет перекрываться. – Acet

Смежные вопросы