2012-03-13 12 views
0

私は編集テキストの高さと幅を固定しています。 入力を開始すると、カーソルが中央に表示されます。 カーソルを編集テキストの先頭から挿入します。 これをどのように達成できますか? あなたが(内容が整合しなければならない)ビューの重力を設定する必要が最初から編集テキストにデータを入力する

<EditText 
     android:id="@+id/txtMessage" 
     android:layout_width="230dp" 
     android:layout_height="120dp" 
     android:inputType="textMultiLine"    
     android:maxLength="100"/> 

答えて

3

次のように編集したテキストのための私のコードです。

android:gravity="left|top" 
1

私はウルのコードとそのは非常に細かい作業をテストしている....

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

    <EditText 
     android:id="@+id/txtMessage" 
     android:layout_width="230dp" 
     android:layout_height="120dp" 
     android:inputType="textMultiLine" 
     android:maxLength="100" /> 

</LinearLayout> 

重力の必要はありません

....

1

hiiiii user1203673

あなたがこれを行うことができます修正幅だけのようなものですが、高さを修正してはいけませんカーソルを始める人からposotionを取得してください これを試してください

関連する問題