【发布时间】:2014-03-20 18:26:38
【问题描述】:
对不起我的英语。我试图将我的文本保留在 TextView 上,但是当我设置大尺寸时他会向下移动。我已经设置了 android:gravity="center|left"。当尺寸小时没有问题。看起来不错。
text small size(抱歉我不能发图片)
不幸的是,如果我将大小设置为更大的文本会向下移动。
如果我再增加尺寸,文字也会消失。 1)如何防止文本移动? 2)如何防止文字消失?
我的 xml 文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
android:orientation="horizontal"
android:padding="@dimen/fragmentDialogPad" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<EditText
android:id="@+id/textSizeET"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number" >
</EditText>
<SeekBar
android:id="@+id/textSizeSB"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="500" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center" >
<Button
android:id="@+id/buttonOka"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/okay" />
<Button
android:id="@+id/buttonCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cancel" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/sampleTV"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center|left"
android:singleLine="true"
android:includeFontPadding="false"
android:text="Sample" />
</LinearLayout>
【问题讨论】:
-
如果你能发布你的xml文件就好了..