My “graphical design” has four rows of textviews and a listview below the textview, everything is nested in linear layouts.
My xml code behind the design is as follows
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:gravity="left" android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView android:id="@+id/tvs_pname"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="Project Name:" android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView android:id="@+id/tv_pname"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView android:id="@+id/tvs_pamount" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Budgeted Amout:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView android:id="@+id/tv_pamount" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView android:id="@+id/tvs_pstartdate"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="Start Date:" android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView android:id="@+id/tv_pstartdate"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView android:id="@+id/tvs_penddate"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="End Date:" android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView android:id="@+id/tv_penddate" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
</LinearLayout>
<LinearLayout android:layout_height="fill_parent"
android:layout_width="fill_parent" android:orientation="vertical">
<ListView android:id="@+id/lst_projlist"
android:layout_width="fill_parent" android:layout_height="fill_parent">
</ListView>
</LinearLayout>
</LinearLayout>
the problem is that when I run my app on emulator the textviews appear just like the design but the listview does not appear below it. Why is this happening.
Experimentally I deleted the listview from my code and out a button there instead. when I ran my app both the textview and button appeared in the emulator just like the design.
So what is the problem with my code?? Am I missing some property in the listview??
I’m a total newbie so I know I could be making a very basic mistake
Have you added an element in your listview?
Dont know if this is the solution – working not so often with emulator, but try it.