我在編排Spinner
時遇到問題。我的實際需求是將Spinner
放在佈局的頂部。listview在每一行添加微調框?
此輸出我得到:
我有相對佈局
<Spinner
android:id="@+id/spinner1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:entries="@array/string_array"
android:prompt="@string/spinner_msg"
/>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/notesTextView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceMedium"
</TextView>`
MyActivity
類是由ListActivity
擴展這裏的onCreate
方法
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
listView=getListView();
listView.setOnItemClickListener(listener);
spinner1=(Spinner)findViewById(R.id.spinner1);
getDetailsCursor();
String[] from = new String[] {"db_column"};
int[] to = new int[] { R.id.notesTextView};
curAdapter=new SimpleCursorAdapter(MyActivity.this, R.layout.mylist, null, from, to);
setListAdapter(curAdapter);
registerForContextMenu(listView);
}`
你想要所有的旋轉器在頂部還是?當我看到它時,微調器在頂部? – Evilunclebill 2013-02-21 12:57:58
請重新說明您的要求併發布您的佈局XML。 – 2013-02-21 12:58:59
我只想要一個微調器在上面。但它通過列表視圖Evilunclebill – PSK 2013-02-21 13:00:36