我的Activity的布局中有一个ListView。 listview_layout.xml如何在ListView中获得微调器
<?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" >
<ListView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/MyListView" />
</LinearLayout>
我使用的另一种布局的ListView列表项。
listitem_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/RelativeLayout01"
android:layout_width="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent">
<TextView
android:id="@+id/txtTitle"
android:layout_width="80dp"
android:layout_height="wrap_content" />
<Spinner
android:id="@+id/MySpinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
我的动态的布局与listview_layout.xml的相同。
我用SimpleAdapter引用了listitem_layout.xml的布局。
问题:现在我想获得listview_layout.xm的微调控件ID。
我在ListView的活动中使用findViewById(MySpinner),它有空指针异常的错误。 找不到。因为活动布局文件使用listview_layout.xml中的listview_layout.xml和Spinner控件。
任何人的帮助都非常感谢。