【问题标题】:Android tabwidget tabs width fixAndroid tabwidget 标签宽度修复
【发布时间】:2013-07-21 16:47:12
【问题描述】:

我在Android remove space between tabs in tabwidget 中关注了 rekaszero 的答案,但现在我需要将选项卡设置为自动适应屏幕(在这个 mini-tut 中它们太大并且它们不在屏幕上)并且还需要删除文本,因为选项卡应该只有图标来占据整个选项卡而不是文本。我可以在 main.class 中设置它们的宽度,但我不想设置它们的宽度,但它们适合自动。

有人可以帮帮我吗? 谢谢

【问题讨论】:

    标签: android tabs tabwidget


    【解决方案1】:

    好的。我用 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>
    

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多