littleK
littleK

Reputation: 20123

Android cannot get TextViews to display with LinearLayout

I am simply trying to create a layout where there are multiple TextViews (and ultimately an EditText) stacked vertically in the activity. However, the only thing displayed is my top title bar and the first TextView (with the "Name" text). Why won't anything else show up? Here is my code:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout android:orientation="vertical"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    android:layout_weight="1">

    <TextView android:text="Name:" android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:textColor="#4096cc"
        android:paddingTop="15dip" android:paddingLeft="15dip"
        android:textSize="20sp" />

    <TextView
        android:text="This is my little description."
        android:layout_width="wrap_content" android:layout_height="fill_parent"
        android:textColor="#333333" android:paddingTop="10dip"
        android:paddingLeft="15dip" android:textSize="10sp" />

    <EditText android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

</LinearLayout>

Thanks!

Upvotes: 0

Views: 372

Answers (1)

EboMike
EboMike

Reputation: 77722

Your layout_height for the TextView needs to be wrap_content, not fill_parent.

Upvotes: 2

Related Questions