.Android TextView 위젯에 표시 할 줄에 줄 바꿈을 삽입하려면 어떻게해야합니까?
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="line 1 \n line 2"/>
그러나이 텍스트보기에 문자열을 표시하려고하면 새 줄로 이동하지 않습니다.
String sample = "line 1 \n line 2";
textView1.setText(sample);
참고 : 사실 내가 SQLite 데이터베이스에서 문자열을 얻고있다. 그러나 그것은 차이를 올바르게 만들어서는 안된다. Beacause는 여전히 String입니다.
sample = cursor.getString(DBAdapter.COL_sample);
textView1.setText(sample);
그래서, 지금 내 텍스트 뷰는 "\ n"또는 "\ r에 \ n"대신 줄 바꿈의 문자를 보여줍니다.
두 경우 모두 나를 위해 작동 ... 본 [이] (http://stackoverflow.com/questions/5382490/how-to-add-a-line-break-in-an-android-textview) ? rq = 1)? – Onik
내가 가지고 있지만, 그것은 어떤 API 레벨이을에 대한 테스트 슬프게도 – AspiringDeveloper
작동하지 않는 이유는 무엇입니까? – singularhum