1
我提出一個應用程序,我有以下XML文件:使用<include/>在android系統編程
<?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:orientation="vertical"
android:background="#f4f4f4" >
<ExpandableListView
android:id="@+id/lvExp"
android:layout_width="match_parent"
android:layout_height="325dp" />
<Button
android:id="@+id/add_claim"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Add Claim" />
</LinearLayout>
我做了一個叫View_list按鈕希望只看到整個頁面的擴展列表視圖。我所做的就是創建一個新的XML文件,並添加follwing包括聲明:
<include android:id="@+id/lvExp"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
不過,我意識到這將現在有兩個原因
1工作 - 沒有佈局ID
2-我只想要列表,而不是按鈕以及其他所有我要放入原始佈局的東西。將要發生的事情是,如果我將某些東西添加到列表中,我需要能夠查看它,而無需添加任何東西。因此
我的問題是這樣的:
如何找到佈局ID,我怎麼能防止整個佈局進行展示,並只顯示列表。我真的很感激一些建議。
謝謝您的信息。你會如何建議我只使用列表呢?我明白你在說什麼,但我不知道如何去做。有什麼建議麼? –
把這個列表本身是一個佈局文件。然後列表中的每個地方你想要它。 –
pzulw
謝謝。這很有道理。 –