2014-04-01 3 views
0

화면 아래쪽에 탭을 정렬하고 싶습니다. alignParentBottom을 사용하여 상대 레이아웃을 사용하려고했으나 성공하지 못했습니다. 아무도 나를 안내 할 수 있습니까?fragmenttabhost에서 화면 하단의 탭을 정렬하는 방법

<android.support.v4.app.FragmentTabHost 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+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" > 

     <TabWidget 
      android:id="@+id/tabs" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_weight="0" 
      android:orientation="horizontal" /> 

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

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

탭은 항상에서 상위에 있어야합니다 droid –

+0

당신이 사용하는 코드를 게시했습니다 ... 나는 그것이 당신을 도울 것이라고 희망합니다 ... –

답변

0
그냥 전부 당신의 탭 위젯으로이 두 줄을 추가

...

 <TabWidget 
     android:id="@+id/tabs" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_gravity="bottom" 
     android:gravity="bottom" 
     android:layout_weight="0" 
     android:orientation="horizontal" /> 
+0

그것도 작동하지 않습니다. – user3484050

0

하단의 탭을 찾습니다 나쁜 관행이지만, 당신이 필요로하는 경우, 중량 안드로이드 위젯을 숨길 = 0 자신의 "realcontent"작업 FrameLayut

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

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

     <FrameLayout 
      android:id="@android:id/tabcontent" 
      android:layout_width="0dp" 
      android:layout_height="0dp" 
      android:layout_weight="0"/> 
     <FrameLayout 
      android:id="@+android:id/realtabcontent" 
      android:background="@drawable/bg_main_app_gradient" 
      android:layout_width="match_parent" 
      android:layout_height="0dp" 
      android:layout_weight="1"/> 
     <TabWidget 
      android:id="@android:id/tabs" 
      android:background="#EAE7E1" 
      android:orientation="horizontal" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_weight="0"/> 
    </LinearLayout> 
</TabHost> 

https://stackoverflow.com/a/23150258/2765497

관련 문제