0

我在 LinearLayout 中添加了四个文本视图,如下所示。

<LinearLayout
    android:id="@+id/aboutLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/transparentbg"
    android:orientation="vertical">

    <ScrollView
        android:id="@+id/scrollView2"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true"
        android:fitsSystemWindows="true"
        android:focusable="true">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/blackbutton"
            android:orientation="vertical" >

            <TextView
                android:id="@+id/aboutTitle"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="10dp"
                android:text="@string/aboutTitle"
                android:textColor="@color/white_color"
                android:textSize="17dp"
                android:textStyle="bold"
                android:layout_weight="1"/>

            <TextView
                android:id="@+id/aboutDesc"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_margin="10dp"
                android:text="@string/aboutText"
                android:textSize="16dp"
                android:layout_weight="1"/>

            <TextView
                android:id="@+id/howToUse"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="5dp"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="10dp"
                android:text="@string/howToUseTitle"
                android:textColor="@color/white_color"
                android:textSize="17dp"
                android:textStyle="bold"
                android:layout_weight="1"/>

            <TextView
                android:id="@+id/howToUseDesc"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_margin="10dp"
                android:text="@string/howToUse"
                android:textSize="16dp"
                android:layout_weight="1"/>
        </LinearLayout>
    </ScrollView>
</LinearLayout>

但是文本被换行了,文本被截断了。有什么问题?当我在 Samsung Galaxy Note中进行测试时,这是一个折腾,但在Galaxy Nexus中,它似乎非常好。

此视图设置为 TabHost 的内容,如下所示

final TabHost tabHost = getTabHost();
LayoutInflater.from(this).inflate(R.layout.main, tabHost.getTabContentView(), true);

tabHost.addTab(tabHost.newTabSpec("Altimeter")
        .setIndicator("",getResources().getDrawable(R.drawable.altimeter_32))
        .setContent(R.id.altimeter));
tabHost.addTab(tabHost.newTabSpec("Settings")
        .setIndicator("",getResources().getDrawable(android.R.drawable.ic_menu_manage))
        .setContent(R.id.settingsAltimeter));
tabHost.addTab(tabHost.newTabSpec("About")
        .setIndicator("",getResources().getDrawable(android.R.drawable.ic_menu_info_details))
        .setContent(R.id.aboutLayout));

文本设置在字符串中,如下所示:

<string name="howToUse">1) Detects transformation gestures involving more than one pointer ("multitouch") \nDetects transformation gestures involving more than one pointer ("multitouch") \n\n 2)Detects transformation gestures involving more than one pointer ("multitouch") y.\n\n 3) Detects transformation gestures involving more than one pointer ("multitouch") .\n\n 4) Detects transformation gestures involving more than one pointer ("multitouch") \n\n 5) Detects transformation gestures involving more than one pointer ("multitouch") \n\n</string>

4

1 回答 1

-1

这是我分配给导致此问题的活动的错误主题。

于 2012-07-11T09:36:52.657 回答