Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/216.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Android中使用相对布局上的单选按钮_Android_List_Layout_Button - Fatal编程技术网

在Android中使用相对布局上的单选按钮

在Android中使用相对布局上的单选按钮,android,list,layout,button,Android,List,Layout,Button,我目前有一个Android项目,有一个相对的布局 我想让用户设置一个选项(从一个很长的列表中)。 环顾四周后,我注意到可以使用单选按钮并在对话框中显示它们,如前所述。 但是我在API上读到单选按钮需要在线性布局中使用 有没有其他方法可以让用户从列表中选择某些内容?例如,一种选择列表 谢谢你的帮助。我已经添加了我当前的布局以进行澄清 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" x

我目前有一个Android项目,有一个相对的布局

我想让用户设置一个选项(从一个很长的列表中)。 环顾四周后,我注意到可以使用单选按钮并在对话框中显示它们,如前所述。 但是我在API上读到单选按钮需要在线性布局中使用

有没有其他方法可以让用户从列表中选择某些内容?例如,一种选择列表

谢谢你的帮助。我已经添加了我当前的布局以进行澄清

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FFFFCC" >

    <Button
        android:id="@+id/buttonExit"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:text="Exit" />

    <Button
        android:id="@+id/buttonStart"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="52dp"
        android:text="Play" />

    <Button
        android:id="@+id/buttonStop"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/buttonStart"
        android:layout_marginTop="21dp"
        android:text="Pause" />

    <Button
        android:id="@+id/Continue"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/buttonStop"
        android:layout_marginTop="16dp"
        android:text="Continue" />

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/Continue"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="36dp"
        android:text="Ready."
        tools:context=".MainActivity" />


</RelativeLayout>

您可以使用微调器或ListView

您可以在此处找到信息和示例:

您考虑过使用微调器吗?您可以轻松地将
射线组
包装成
线性布局
@fiddler微调器似乎是个好主意。让我试试。。。对好的Android布局教程有什么建议吗?现在看看谷歌和开发者网站。