0
TextViewをRadioButtonに水平に揃える必要があります。xamarin androidはTextGroupを水平方向にRadioGroupに整列します
私はTableRowを持っています。その中には、TextViewとRadioButtonが横に3つあります。 TextViewのテキストは、行の上部に水平に整列して表示されますが、水平に配置する必要があるため、同じ行に表示されます。
私のコードは次のとおりです。
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TableLayout
android:id="@+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TableRow
android:gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textSize="11sp"
android:text="Falta 220 V" />
<RadioGroup android:orientation="horizontal">
<RadioButton android:id="@+id/rdAlarma"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="11sp"
android:textStyle="bold"
android:text="SI" />
<RadioButton android:id="@+id/rdCCTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="11sp"
android:textStyle="bold"
android:text="NO" />
<RadioButton android:id="@+id/rdIncedio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="11sp"
android:textStyle="bold"
android:text="NA" />
</RadioGroup>
</TableRow>
</TableLayout>
</LinearLayout>
</FrameLayout>
そして、それはこのようになります。
を!!!!しかし、どのようにテキストを右に揃えることができますか?ありがとう – Diego
['android:textAlignment'](https://developer.android.com/reference/android/view/View.html#attr_android:textAlignment)を使ってみましたか? – Demitrian
I android:gravity = "center_vertical | right"を使って解決しました..ありがとう!! – Diego