Android RadioButton左侧显示文字,右侧显示Button

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_40543575/article/details/89957815

RadioButton左侧显示文字及右侧显示Button

现在新翻新的项目遇到了一个RadioButton左侧显示文字及右侧显示button的设计,遗憾的,度娘没能帮到我

stackoverflow中记录了一个方法

<RadioButton
        android:id="@+id/item_list_radiobtn"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:button="@drawable/radio_button_style_knowledgechild"
        android:layoutDirection="rtl"
        android:textColor="@color/color_333333"
        android:textDirection="ltr"
        android:textSize="@dimen/sp_14"
        tools:ignore="RtlCompat"
        tools:text="偿付能力-债券与权益比" />

其实就是让RadioButton的布局方向由从左至右改为从右至左,再把text改为从左至右!(就是把按钮和文字的默认布局改成相反就行了)

 

猜你喜欢

转载自blog.csdn.net/qq_40543575/article/details/89957815
今日推荐