对于 android 编程,我有一个包含一些 RadioButtons 的 RadioGroup。我只想从按钮中获取文本,而无需获取 RadioButton 的 ID。
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/radioGroup"
>
<RadioButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="text1"
/>
<RadioButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="text2"
/>
<RadioButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="text3"
/>
</RadioGroup>
是否可以只获取文本?
慕姐4208626
三国纷争
慕哥9229398
随时随地看视频慕课网APP
相关分类