我有兩個文本視圖(TV_1,TV_2)。我想設置TV_2是TV_1的直接權利。 這意味着android - 如何安排兩個textview並排
- 假設TV1佔據屏幕上的一整行,然後TV2將設置在TV1下面。
- 假設Tv1佔據一行半,那麼tv2將佔據空間的其餘部分。如何實現這一點?我嘗試過,但我沒有得到。它與一段相似。
<RelativeLayout
android:id="@+id/xrays_dicom_alert_TnC"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_marginTop="20dp">
<CheckBox
android:id="@+id/xrays_dicom_alert_cb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"/>
<TextView
android:id="@+id/xrays_dicom_alert_TnC_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/xrays_dicom_alert_cb"
android:text="I have read I agree to the following"
android:textColor="@color/black"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/xrays_dicom_alert_statement"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/xrays_dicom_alert_cb"
android:layout_below="@id/xrays_dicom_alert_TnC_text"
android:layout_alignRight="@id/xrays_dicom_alert_TnC_text"
android:text="Statement"
android:textColor="@color/black"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
請發佈您的佈局xml文件。 –
你爲什麼要這樣?你也可以使用單個文本視圖來做到這一點,因爲我看到你的XML。 –
我想設置第二個文本視圖是可點擊的。 – naresh