我想在廣播組中的單選按鈕旁邊設置視圖。我試過,但我沒有得到。請任何人都可以幫助我。android - 如何在單選按鈕旁邊添加視圖
源代碼
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#FFFFFF">
<RadioGroup
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:checkedButton="@+id/view_completehistroy_rb"
android:id="@+id/timeframe_group">
<!-- View complete history Radio Button -->
<RadioButton
android:text="Complete History"
android:textSize="16sp"
android:layout_marginLeft="5dp"
android:id="@+id/view_completehistroy_rb"
android:textColor="#000000"
/>
<!-- View history using date range Radio Button -->
<RadioButton
android:text="From"
android:textSize="16sp"
android:layout_marginLeft="5dp"
android:textColor="#000000"
android:id="@+id/view_daterange_history_rb"/>
</RadioGroup>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<!--Layout for Time selection -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="5dp"
android:layout_toRightOf="@id/view_daterange_history_rb">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:text="test1"
android:textColor="#000000"
android:textSize="16sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:text="test2"
android:textColor="#000000"
android:textSize="16sp"/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
我認爲它不可能。但是如果你解釋爲什麼你需要這樣做,我們可以找出其他方法。 我認爲你想在這些文字瀏覽中顯示兩個日期。對? – 2012-08-09 12:53:28
在這裏,我想使用daterange選項,如「從日期選擇器到DatePicker」這就是爲什麼 – naresh 2012-08-09 12:58:06
基於這個評論,@RahmathullahMPulikkal的答案應該是最好的解決方案,而不是試圖在旁邊放置一個新的視圖 – Cameron 2012-08-09 13:15:31