5
こんにちは私はターミナルやcmdのように表示するテキストを取得しようとしています。そして、私は、各入力で新しい行を作成し、次にTextView
の下の行を表示するテキストのウィンドウを意味し、常に画面上に一定量の行が存在することを意味します。Textviewは端末のように動作します
これは簡単に聞こえましたが、今は始めてから、どのように行うのかよく分かりません。
私は
にこのすべての作品を新しい行を追加するには、この
<?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="fill_parent"
android:orientation="vertical"
android:weightSum="100" >
<ScrollView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView android:id="@+id/tv1"
android:layout_width="wrap_content"
android:minLines="11"
android:maxLines="11"
android:layout_height="wrap_content"/>
</ScrollView>
<EditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="10" >
<requestFocus />
</EditText>
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="10"
android:onClick="buttonclick"
android:text="Button" />
</LinearLayout>
、その後
sss=et1.getText().toString();
tv1.append("\n"+sss);
ようScrollView
でTextView
を入れてみましたが、私は本当に作り方見当がつかないTextView
は一番下に行くと、今度は最大ライン数に達したときに切断されます。
誰かが私のプログラムを私のために書くことは間違いありません。私は学ぶためにここにいる
お時間をありがとう!
ありがとうございます!私のレイアウトファイルを書き直さなければならなかったが、うまくいった。 – DisibioAaron