Android 如何在单选按钮旁边放置微调器
我有这样的布局: (由于我的声誉还不到10岁,我真诚地请求您查看此图像链接) 我想在最后一个单选按钮旁边放一个微调器,如图所示 这是我的密码:Android 如何在单选按钮旁边放置微调器,android,android-layout,radio-button,spinner,radio-group,Android,Android Layout,Radio Button,Spinner,Radio Group,我有这样的布局: (由于我的声誉还不到10岁,我真诚地请求您查看此图像链接) 我想在最后一个单选按钮旁边放一个微调器,如图所示 这是我的密码: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<!-- Linearlayout containing the Search/Find Customer -->
<!-- TextView for Search/Find Customer -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Search/Find Customer" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<EditText
android:id="@+id/etSearch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@layout/roundable_edittext"
android:hint="@string/hint_search" >
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Search" />
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Cancel" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp" >
<TextView
android:id="@+id/Options"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Search/Find Customer" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<RadioButton
android:id="@+id/rdAllCustomers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="All Customers" />
<RadioButton
android:id="@+id/rdToday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Today" />
<RadioButton
android:id="@+id/rdToday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Owner\'s Name" />
<RadioButton
android:id="@+id/rdToday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Trade Name" />
<RadioButton
android:id="@+id/rdToday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Itinerary" />
</RadioGroup>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >
<Spinner
android:layout_width="163dp"
android:layout_height="wrap_content"
android:entries="@array/spinner_itinerary"
android:gravity="bottom" />
</LinearLayout>
</LinearLayout>
提前谢谢 伙计,你不应该在单选按钮旁边使用微调器,这不是一个好的设计实践,你应该把微调器放在单选按钮下面,如果用户选择了单选按钮,你就可以看到微调器。我同意@Witalo。《Android设计指南》强烈建议不要模仿非Android移动操作系统(iOS、Windows Phone等)的设计。但是,如果您的客户/客户需要,我可以考虑以下选项:
- 子类
,它绘制一个单选按钮
微调器
- 或者,使用
RelativeLayout