1

これが私の編集テキストの外観です。テキストが引き伸ばされ、単語間に不要なスペースが追加されます

ここに画像の説明を入力

これはstrings.xmlのテキストです:

<string name="type_msg">Type your message...</string>

これはレイアウト xml コードです。

<EditText
            android:id="@+id/chat_message"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:clickable="false"
            android:scrollbarStyle="outsideOverlay"                   
            android:background="@drawable/chat_text_box_corners"
            android:maxLines="4"     
            android:minLines="1"   
            android:scrollbars="vertical"                                   
            android:hint="@string/type_msg"               
            android:paddingTop="7dp"
            android:paddingBottom="7dp"
            android:paddingLeft="10dp" 
            android:paddingRight="10dp" 
            android:layout_marginTop="15dp"
            android:layout_marginBottom="15dp"
            android:layout_marginRight="7dp"
            android:layout_marginLeft="7dp"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:textColor="@color/gray_text"
            android:layout_toLeftOf="@id/send_message"
            android:layout_toRightOf="@id/call_btn"               
           />

次のように入力しても同じように機能します。

ここに画像の説明を入力

4

1 に答える 1

0

settextAndroidには水平方向のスケーリングに使用される属性があります..それにoftext応じてテキストを調整します。

このリンクを確認してください: http://developer.android.com/reference/android/widget/TextView.html#attr_android:textScaleX

于 2013-07-11T12:03:09.243 に答える