3

これは私のxmlファイルです

<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <TabWidget
        android:id="@android:id/tabs"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" 
        android:gravity="center" >
    </TabWidget>

    <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >
 </FrameLayout>
</LinearLayout>

</TabHost>

これは私の .class ファイルです

    TabHost tabHost = getTabHost();

    TabSpec ta1= tabHost.newTabSpec("title");
    ta1.setIndicator("title");
    Intent ta1intent = new Intent(this, 1_webview.class);
    ta1.setContent(ta1intent);

    TabSpec ta2= tabHost.newTabSpec("title1");
    ta2.setIndicator("Title1");
    Intent ta2intent = new Intent(this, 2_webview.class);
    ta2.setContent(ta2intent);

    TabSpec ta3= tabHost.newTabSpec("two linetitle");
    ta3.setIndicator("Two line title");
    Intent ta3intent = new Intent(this, 3_webview.class);
    ta3.setContent(ta3intent);

    TabSpec ta4 = tabHost.newTabSpec("two line title");
    ta4.setIndicator("Two line //n title");  //tried using line break displays Two line \N title 
    Intent ta4intent = new Intent(this, week_webview.class);
    ta4.setContent(ta4intent);

これは私が得るものです

出力画像

tab3 と tab4 のタイトルをトリミングするのではなく複数行にする方法はありますか? tab3 と tab4 の実際のテキストは「2 行のテキスト」ですが、2 行だけが表示されます。

または、すべての単語が表示されるようにフォント サイズを小さくする方法はありますか?

4

3 に答える 3