2013-07-21 114 views
0

我已经按照rekaszero在Android remove space between tabs in tabwidget的答案,但现在我需要设置标签自动适合屏幕(在这个迷你图腾他们太大,他们离开屏幕),也需要删除文本,因为标签应该只有图标占据整个标签而不是文本。我可以在main.class中设置它们的宽度,但我不想设置它们的宽度,但它们适合自动。安卓tabwidget标签宽度修复

有人可以帮我吗? 谢谢

回答

0

好的。我想通过在main.xml上使用此代码替换这个大制表符宽度:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" > 

    <TabHost 
     android:id="@android:id/tabhost" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentTop="true" > 

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

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

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

</RelativeLayout> 

现在我将尝试从中删除文本。如果你已经知道如何帮助我。谢谢