Как и в случае контактов в разделе контактов андроидов, в котором есть панель поиска сверху, с динамическим видом списка ниже, example here, я пытаюсь использовать счетчик вместо текстового поля ,статический заголовок с проблемами динамического просмотра списка
Моя проблема заключается в том, что в макете Spinner повторяет элемент списка.
У меня есть следующий list.xml файл:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<Spinner
android:id="@+id/spinner1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/row"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/sc" />
<TextView
android:id="@+id/rowData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</RelativeLayout>
и последующей Java:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
application = ((MyAppApplication) getApplication());
populateOffers();
}
private void populateOffers()
{
MyAppRequestor MyApp = new MyAppRequestor();
ArrayList<String> list = MyApp.items(application.getMyAppId());
adapter = new ArrayAdapter<String>(this,
R.layout.list, R.id.rowData, list);
setListAdapter(adapter);
}