相关疑难解决方法(0)

如何更改标签的大小

实际上我已经在我的应用程序中创建了一个选项卡.这里有三个选项卡..但事实是我无法在标签中管理样式更多我希望一个选项卡的大小比其他两个选项卡大我发送我的代码u plese核实..

XML代码:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent" 
android:layout_width="match_parent" 
android:orientation="horizontal"
>
Run Code Online (Sandbox Code Playgroud)

<LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:padding="5dp">
    <TabWidget
        android:id="@android:id/tabs"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" 
        />
    <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:padding="5dp" 
        />

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

Java代码:

setContentView(R.layout.main);
    Resources res = getResources(); 
    TabHost tabHost = getTabHost();  
    TabHost.TabSpec spec; 
    Intent intent;  

    // Create an Intent to launch an Activity for the tab (to be reused)
    intent = new Intent().setClass(this, ContactActivity.class);

    spec = tabHost.newTabSpec("Contacts").setIndicator("Contacts",
                      res.getDrawable(R.drawable.ic_tab_artists))
                  .setContent(intent);
    tabHost.addTab(spec);


    // Do the same for the other tabs
    intent = new Intent().setClass(this, CallActivity.class);
    spec = …
Run Code Online (Sandbox Code Playgroud)

android

0
推荐指数
1
解决办法
2万
查看次数

标签 统计

android ×1