I am having an issue where only the text of the first TextView (eventItemTitle) displays. As you can see I have now changed to inserting a literal string, but still only see the title.
What am I doing wrong?
layout:
<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>
Activity Class:
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");
Looks like you forgot to specify orientation on your LinearLayout, which by default is horizontal. So right now your second textview is appearing, but the other one fills up the horizontal distance on the screen and the first is being pushed off the edge. set it to vertical and I think you’ll be good.