2012-02-24 4 views
0

맨 아래 탭에 레이아웃이 있습니다. 그러나 tabHost 위에 스트립을 설정할 수 없습니다. 그것을하는 방법? 고맙습니다. 또한안드로이드는 아래쪽 탭 위에 탭 스트립을 가져옵니다.

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

     <FrameLayout 
      android:id="@android:id/tabcontent" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_weight="1" > 
     </FrameLayout> 

     <TabWidget 
      android:id="@android:id/tabs" 
      android:layout_width="fill_parent"      
      android:layout_height="wrap_content" 
      android:layout_weight="0" 

    /> 
    </LinearLayout> 

</TabHost> 

및 탭 스타일을위한 선택 : 여기

내 주요 레이아웃

<selector xmlns:android="http://schemas.android.com/apk/res/android"> 

<item android:state_pressed="true" > 
    <shape> 
     <gradient 
      android:startColor="#aa3434" 
      android:endColor="#432233" 
      android:angle="270" 
      /> 
    </shape> 
</item> 

<item android:state_selected="true" > 
    <shape> 
     <gradient 
      android:startColor="#aa3434" 
      android:endColor="#432233" 
      android:angle="270" /> 
    </shape> 
</item> 

enter image description here

답변

0

이 코드를 시도

<?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" 
      android:layout_weight="0" /> 
     <FrameLayout 
      android:id="@android:id/tabcontent" 
      android:layout_width="fill_parent" 
      android:layout_height="0dip" 
      android:layout_weight="1" /> 
    </LinearLayout> 

</TabHost> 
+0

하지만 변화를 시도 : ( – Jaume

+0

이 코드는 이미 내 프로젝트 –

+0

하단의 탭을 사용하여 구현됩니까? – Jaume

관련 문제