the layout main.xml file
<?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="wrap_content"
        android:gravity="fill_vertical|fill_horizontal|fill"
        android:id="@+id/brlayout"
    >
        <HorizontalScrollView
                android:id="@+id/scrollview1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                >
                <LinearLayout
                        android:id="@+id/svlayout01"
                        android:orientation="horizontal"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        >
                        <Button
                                android:id="@+id/home"
                                android:layout_width="fill_parent"
                                android:layout_height="fill_parent"
                                android:background="@drawable/btn_home"
                                >
                        </Button>
                        <Button
                                android:id="@+id/parent"
                                android:layout_width="fill_parent"
                                android:layout_height="fill_parent"
                                android:background="@drawable/btn_parent"
                                >
                        </Button>
                        <Button
                                android:id="@+id/mutisellect"
                                android:layout_width="fill_parent"
                                android:layout_height="fill_parent"
                                android:background="@drawable/btn_multi_select"
                                >
                        </Button>

                </LinearLayout>

        </HorizontalScrollView>


        <ListView
                android:id="@+id/brListView"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                />

</LinearLayout>

the onCreate() func
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
                //initView();
        ArrayList<HashMap<String, Object>> listitem = new
ArrayList<HashMap<String,Object>>();
        for(int i = 0; i < 10; i++) {
                HashMap<String, Object> map = new HashMap<String, Object>();
                map.put("text_content", "test content" + i);
                listitem.add(map);
        }

        SimpleAdapter listitemadapter = new SimpleAdapter(this,
listitem,
                        R.layout.list_item,
                        new String[] {"text_content"},
                        new int[] {R.id.mytext} );

                ListView listview = (ListView)findViewById(R.id.brListView);
                listview.setAdapter(listitemadapter);

I can not find the ListView, But When I chang the LinearLayout to
TableLayout, the ListView show up. So What's the problem?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to