<RadioButton
android:id="@+id/british_stock"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:button="@null" 将button 设置为@null 即可,方便快捷!
android:gravity="center"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:textColor="@color/c_theme_title_text"
android:textSize="15sp"
android:text="英股"
/>
//还有一种就是用代码这样创建RedioButton ,这样出来也不会有小圆点
RadioButton rb = (RadioButton) LayoutInflater.
from(getActivity()).inflate(R.layout.
nav_radiogroup_item, null)
;
rb.setId(i)
;
rb.setText(
listData.get(i))
;
rb.setTextSize(
17)
;
ViewGroup.LayoutParams params =
new ViewGroup.LayoutParams(
indicatorWidth, ViewGroup.LayoutParams.
MATCH_PARENT)
;
rb.setLayoutParams(params)
;
rg_nav_content.addView(rb)
;
转载请注明原文地址: https://ju.6miu.com/read-22428.html