我需要設計一個類似於我的附加圖像的用戶界面。我需要設置TextView的幫助,例如它與單選按鈕居中對齊。 TextView的中心位置和單選按鈕的中心位置應該在同一條垂直線上。
0
A
回答
1
您可以使用相對佈局這樣,
<?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:gravity="center"
android:orientation="vertical">
<RelativeLayout android:id="@+id/rlCell"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<RadioButton android:text="" android:gravity="center_vertical|center_horizontal" android:id="@+id/radioButton1" android:layout_width="wrap_content" android:layout_height="wrap_content"></RadioButton>
<TextView android:layout_below="@+id/radioButton1" android:id="@+id/textView1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="TextView" android:layout_alignLeft="@+id/radioButton1" android:layout_alignRight="@+id/radioButton1"></TextView>
<RadioButton android:text="" android:layout_toRightOf="@id/radioButton1" android:id="@+id/radioButton2" android:layout_width="wrap_content" android:layout_height="wrap_content"></RadioButton>
<TextView android:layout_below="@+id/radioButton2" android:id="@+id/textView2" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="TextView" android:layout_alignLeft="@+id/radioButton2" android:layout_alignRight="@+id/radioButton2"></TextView>
</RelativeLayout>
</LinearLayout>
相關問題
- 1. Android UI問題
- 2. 的Android UI問題
- 3. Android UI的問題
- 4. Android UI佈局問題
- 5. Android UI重疊問題
- 6. Android UI初學者問題
- 7. Android的UI TabActivity問題
- 8. 問題與Android Studio UI
- 9. Xamarin形式和FreshMVVM Android的UI問題
- 10. 幫助與Android UI的ListView問題
- 11. Android UI編輯器/顯示器問題
- 12. 基礎的Android UI設計問題
- 13. Android UI圖像內存問題
- 14. Android拖放UI開發問題
- 15. Android UI問題。實施指南
- 16. Android更新UI主線程問題
- 17. android:真正的設備問題的UI
- 18. Android - 關於System-UI的問題
- 19. 在Xamarin中設計Android UI的問題
- 20. UI線程問題
- 21. JQuery UI主題問題
- 22. jQuery Resizable()UI問題
- 23. AngularJS ui-select問題
- 24. JQuery UI iframe問題
- 25. jQuery UI datepicker問題
- 26. jquery-ui datepicker問題
- 27. UI-Grid Exporter問題
- 28. 創建UI問題
- 29. Kendo UI Tooltip問題
- 30. Internet Explorer UI問題
用相對的觀點。 – L7ColWinters 2012-03-19 06:42:05
使用相對佈局,並提出問題之前做一些谷歌搜尋,,, – 2012-03-19 06:43:59
你可以請任何樣品? – Prem 2012-03-19 06:44:03