1

私はテキストビューを持っています.2行以上のテキストがある場合、2行目は1行目になり、その下に空き行があり、最初の行は表示されません。これはアンドロイドテキストビューで可能ですか?

4

3 に答える 3

1

これを試して

<TextView
  android:id="@+id/TextView01"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:singleLine="false"
  android:maxLines="3"
  android:scrollbars="vertical"
  android:textColor="@android:color/secondary_text_dark_nodisable"
>

コード内

TextView textView = (TextView)findViewById(R.id.TextView01);
textView.setMovementMethod(ScrollingMovementMethod.getInstance());
于 2013-02-01T13:12:05.183 に答える
0

はい可能です。高さ 2*text_line_height の scrollView を作成します。の中に TextView を追加します。どこで text_light _height は textSize に比例します。14sp と 8o dp のような組み合わせを試してみてください。良いことは、sp/dp がすべてのデバイス サイズに対して同じ動作を提供することです。

于 2013-02-01T13:14:31.977 に答える
0

はい、見てください。

<ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="match_parent"
        android:layout_height="30dp" >


          <TextView
                android:id="@+id/TextView01"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:singleLine="false"
                android:textSize="20dp"
                android:text="kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk"
                />
    </ScrollView>
于 2013-02-01T13:51:18.640 に答える