0
我遇到了只顯示第一個TextView(eventItemTitle)的文本的問題。正如你所看到的,我現在已經改爲插入一個文字字符串,但仍然只能看到標題。Android問題只有第一個TextView顯示ScrollView裏面的文本
我在做什麼錯?
佈局:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/eventItemTitle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="#FFCC00">
</TextView>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/eventItemDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</TextView>
</LinearLayout>
</ScrollView>
活動課:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.event_item);
[...]
TextView text = (TextView) findViewById(R.id.eventItemTitle);
text.setText(event.getTitle() + "\n");
TextView descTV = (TextView) findViewById(R.id.eventItemDescription);
descTV.setText("i'm here");