Android 게임을 만들고 TextView로 동적 텍스트에 문제가 있습니다. 내 레이아웃 Essentiall, 나는 여러 줄에 대한 충분한 공간과 상대 레이아웃 내에서 TextView있다.Android - 동적 TextView 만들기
내가 뭘하고 싶은지 TextView 내에 5 줄을 추가하면 6 행을 작성하려고 할 때 자동으로 1 행을 덮어 쓰므로 최대 5 행의 텍스트 만 표시합니다.
난 후 나는 무엇의예 :이 내가 텍스트 뷰 내의 텍스트를 업데이트하기 위해 사용하고있는 코드가
<RelativeLayout android:id="@+id/battleconsole"
android:layout_width="fill_parent"
android:layout_height="135dp"
android:gravity="center_horizontal"
android:layout_below="@+id/spacer1" >
<TextView
android:id="@+id/battle_details"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Console with information" />
</RelativeLayout>
:
dynamic line 1
...
dynamic line 5
내 XML 코드를 검색
TextView update = (TextView)findViewById(R.id.battle_details);
update.setText("test console data going in here");
TextView를 사용하여 가능할 지 모르겠다면 다른 방법이 있습니까? 이 문제를 해결합니까?
이렇게 간단하고 우아한 방법으로 ;-) – Darwind
대우, 고마워요. –