我想要一些禁用查看文本的单选按钮,但单选按钮看起来很正常。如何启用单选按钮但禁用文本
用户可以单击单选按钮,将显示一些关于未来版本的挑逗,但我也想清楚地展示哪些功能尚未提供。
这里有一个画面:
而且到目前为止我的代码,实际上,我希望有一个更好的解决方案,但如果情况并非如此下面的代码中存在以下问题:
由于测试无线电设备不是无线电组布局它们不会取消选择其他的兄弟姐妹下,
因为测试实际上是2个收音机(一个是按钮而不是文本,另一个是没有按钮的文本)点击文本不会检查按钮!这实际上很重要!
看起来写多了一行会换行,但它超出线性布局几个像素。
<RadioGroup android:layout_width="match_parent" android:layout_height="match_parent"> <RadioButton android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Normal, unchecked" /> <RadioButton android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Normal, unchecked" /> <RadioButton android:layout_width="match_parent" android:layout_height="wrap_content" android:checked="true" android:text="Normal, checked" /> <RadioButton android:layout_width="match_parent" android:layout_height="wrap_content" android:enabled="false" android:text="Disabled, unchecked" /> <RadioButton android:layout_width="match_parent" android:layout_height="wrap_content" android:checked="true" android:enabled="false" android:text="Disabled, checked, also big line saijdhnasoidasokdmokasmdokasmdkmasdplmaslk;dmsal;kdmas;lmdl;asmdl;mas;ldmasl;dmaslkmdksamdasmdlka" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" /> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:button="@null" android:enabled="false" android:text="Test, unchecked, also big line saijdhnasoidasokdmokasmdokasmdkmasdplmaslk;dmsal;kdmas;lmdl;asmdl;mas;ldmasl;dmaslkmdksamdasmdlka" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:checked="true" /> <RadioButton android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:button="@null" android:enabled="false" android:text="Test, checked" /> </LinearLayout> </RadioGroup>
设置文本颜色相同残疾人 –
改变颜色(?) –
@VladMatvienko好主意,但是是所有Android设备上使用相同的颜色吗? –