0

우리는 화면 오른쪽에 수직 방향으로 Tabwidget을 설치하려고합니다. 그러나 탭이 포함 된 레이아웃의 길이에 맞게 탭의 크기를 조정하는 데 문제가 있습니다.레이아웃 크기, 높이 및 내부 조각 클래스 조정

또한 내부의보기 및 레이아웃에서 크기를 가져 오는 방법을 찾을 수 없습니다.

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="match_parent" 
     android:layout_height="match_parent" > 
    <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:orientation="horizontal" 
      > 
     <FrameLayout 
       android:id="@android:id/tabcontent" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:layout_weight="1" > 
      <LinearLayout 
        android:id="@+id/all" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        > 
       <ListView 
         android:id="@+id/listView1" 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
         android:clipToPadding="false" > 
       </ListView> 
      </LinearLayout> 
      <LinearLayout 
        android:id="@+id/record" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        > 
       <TextView 
         android:id="@+id/tabtxt2" 
         android:layout_width="wrap_content" 
         android:layout_height="80dp" 
         android:layout_gravity="center_horizontal" 
         android:text="Tab 2 Content Jehaw!" > 
       </TextView> 
       <ImageView android:id="@+id/journal_image" 
          android:contentDescription="Journal" 
          android:src="@drawable/ic_launcher" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:layout_gravity="center_horizontal|center_vertical" > 
       </ImageView> 
      </LinearLayout> 
      <LinearLayout 
        android:id="@+id/history" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" 
        > 
       <TextView 
         android:id="@+id/tabtxt3" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:layout_gravity="center_horizontal" 
         android:text="Tab 3 Content Jehaw!" > 
       </TextView> 
      </LinearLayout> 
     </FrameLayout> 

    <LinearLayout android:id="@+id/tabs_layout" 
        android:layout_width="100dip" 
        android:layout_height="match_parent" 
        android:layout_weight="1" > 
     <TabWidget android:id="@android:id/tabs" 
        android:layout_height="match_parent" 
        android:layout_width="wrap_content" 
        android:divider="@color/green" 
        android:rotation="90" 
        android:layout_gravity="center_vertical" 
       > 
     </TabWidget> 
    </LinearLayout> 
    </LinearLayout> 
</TabHost> 

Layout
크기는 수직 방향

+0

android : layout_weight = "1"을 사용해 보았습니까? – Tobiel

+0

예. 있습니다. XML 코드보기 :) –

답변

0

TabWidget 하드 코딩 setOrientation (LinearLayout.HORIZONTAL) 모든 백색 영역 (레이아웃)를 채우기 위해 스트레칭한다; TabWidget init() 메서드에서 사용하고 TabHost는 방향 특성을 지원하지 않으며 탭은 가로로만 사용할 수 있습니다.

관련 문제