我正试图让我的radiobuttons的一些明智的定位,这是RadioGroup的一部分.我遇到了麻烦,因为我的RadioGroup坐在我的布局设计的其余部分之上,然后我使用边距按下按钮,这里的问题是这只适用于一个或两个设备布局.当我发现我可以定义我的RadioGroup然后放入一个RelativeLayout,其中包含一个RadioButtons,然后我再重复两次时,我以为我敲了金.这给了我想要的布局.问题是,当我运行代码时,RadioButtons行为链接独立按钮:(
那么两个问题,
>我可以将这些按钮链接回集团吗?
>是否有一种不错的方法可以独立于集团定义RadioGroup Radiobuttons的布局.
我在想一个替代方案可能是独立的RadioButtons并使用代码来启用/禁用它们,但这确实有点打败了RadioGroup的用处.
谢谢.
如果你好奇,这是我的XML布局.
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="@id/HDDResultsBox"
>
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:focusable="true"
android:focusableInTouchMode="true"
android:windowSoftInputMode="stateHidden"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_below="@id/HDDResultsBox"
>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/backgroundbox"
android:layout_margin="5dp"
android:padding="5dp"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Interval"
android:gravity="left"
android:textColor="#ffffff"
android:textStyle="bold"
android:layout_marginLeft="5dp"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Interval help text"
android:gravity="left"
android:textColor="#ffffff"
android:textSize="8dp"
android:layout_toRightOf="@id/intervalHeader"
android:layout_marginLeft="10dp"
/>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@id/intervalHeader"
android:layout_marginLeft="10dp"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
/>
android:layout_width="75dp"
android:layout_height="40dp"
android:text="50"
android:textSize="14sp"
android:gravity="center"
android:inputType="number"
android:layout_marginLeft="20dp"
/>
android:layout_width="match_parent"
android:layout_height="42dp"
android:drawSelectorOnTop="false"
android:layout_marginTop="1dp"
android:layout_marginLeft="10dp"
android:layout_weight="10"
android:layout_marginRight="2dp"
/>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="100"
android:progress="50"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="8dp"
android:layout_weight="7"
/>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/backgroundbox"
android:layout_margin="5dp"
android:padding="5dp"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Record Duration"
android:gravity="left"
android:textColor="#ffffff"
android:textStyle="bold"
android:layout_marginLeft="5dp"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Record help text"
android:gravity="left"
android:textColor="#ffffff"
android:textSize="8dp"
android:layout_toRightOf="@id/recordHeader"
android:layout_marginLeft="10dp"
/>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@id/recordHeader"
android:layout_marginLeft="10dp"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
/>
android:layout_width="75dp"
android:layout_height="40dp"
android:text="50"
android:textSize="14sp"
android:gravity="center"
android:inputType="number"
android:layout_marginLeft="20dp"
/>
android:layout_width="match_parent"
android:layout_height="42dp"
android:drawSelectorOnTop="false"
android:layout_marginTop="1dp"
android:layout_marginLeft="10dp"
android:layout_weight="10"
android:layout_marginRight="2dp"
/>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="100"
android:progress="50"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="8dp"
android:layout_weight="7"
/>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/backgroundbox"
android:layout_margin="5dp"
android:padding="5dp"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Video Length"
android:gravity="left"
android:textColor="#ffffff"
android:textStyle="bold"
android:layout_marginLeft="5dp"
/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="playBack help text"
android:gravity="left"
android:textColor="#ffffff"
android:textSize="8dp"
android:layout_toRightOf="@id/playBackHeader"
android:layout_marginLeft="10dp"
/>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@id/playBackHeader"
android:layout_marginLeft="10dp"
>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
/>
android:layout_width="75dp"
android:layout_height="40dp"
android:text="50"
android:textSize="14sp"
android:gravity="center"
android:inputType="number"
android:layout_marginLeft="20dp"
/>
android:layout_width="match_parent"
android:layout_height="42dp"
android:drawSelectorOnTop="false"
android:layout_marginTop="1dp"
android:layout_marginLeft="10dp"
android:layout_weight="10"
android:layout_marginRight="2dp"
/>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="100"
android:progress="50"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="8dp"
android:layout_weight="7"
/>