我见过很多关于如何制作微调器的教程,但它们每页只显示一个。当我尝试插入2时,第二个只是不起作用。我以前没有Android编程知识,所以也许我只是把第二个微调代码放在错误的地方。我可以在代码示例中使用一些帮助。
我已经尝试了5次,但我似乎无法在此处发布我的代码,但它只是一个简单的代码,用于一个微调器
谢谢!
答案 0 :(得分:0)
尝试此布局...
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/search_scrvw"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical">
<TableLayout
android:id="@+id/search_table"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dip"
android:layout_marginLeft="50dip" >
<TableRow
android:layout_width="wrap_content"
android:layout_height="match_parent">
<TextView
android:text="Sex"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Spinner
android:id="@+id/spnr_srch_sex"
android:layout_width="150dip"
android:layout_height="wrap_content" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="match_parent">
<TextView
android:text="Age"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Spinner
android:id="@+id/spnr_srch_age"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="match_parent">
<TextView
android:text="Country"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Spinner
android:id="@+id/spnr_srch_country"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</TableRow>
<Button
android:id="@+id/search"
android:text="Search"
android:layout_width="100dip"
android:layout_height="wrap_content" />
</TableLayout>
</ScrollView>
</LinearLayout>