Android 如何在单选按钮旁边放置微调器

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:

我有这样的布局:

(由于我的声誉还不到10岁,我真诚地请求您查看此图像链接)

我想在最后一个单选按钮旁边放一个微调器,如图所示

这是我的密码:

<?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\&apos;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

这是Android中的协议吗?我的项目是模仿一个来自Windows Phone(iPAQ)的.Net程序,它的外观是单选按钮旁边的微调器。这不是一个协议,它只是一个更好的实践设计。你的思维方式看起来很有条理,你知道吗?我说这是我项目的要求,而不是我的思维方式。你还拼错了“无组织”这个词。无论如何,谢谢你的启发,我会对我的团队领导说。谢谢你的选择,我很感激。我可以在radiobutton旁边使用微调器,也可以在radiobutton下面使用微调器,这样我就可以将它呈现给我的团队领导。我还发现完全模仿非android程序的外观是愚蠢的,因为它们的行为非常不同。