问题描述
我想更改活动切换按钮的颜色。但是只是涟漪色彩的变化才有所作为。 我希望自定义活动按钮的背景颜色和文本颜色。
<style name="ToggleButtonGroupStyle" parent="Widget.MaterialComponents.Button.OutlinedButton">
<item name="rippleColor">@color/colorAccent</item>
</style>
在下面的toggleButtonGroup中,我从上面使用了这种样式:
<com.google.android.material.button.MaterialButtonToggleGroup
android:id="@+id/priority_btn_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentLeft="true"
app:selectionRequired="true"
app:singleSelection="true"
app:checkedButton="@+id/btn_one"
>
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_one"
style="@style/ToggleButtonGroupStyle"
android:layout_width="@dimen/priority_btn_width"
android:layout_height="wrap_content"
android:shadowColor="@color/project_text"
android:text="0" />
<com.google.android.material.button.MaterialButton
style="@style/ToggleButtonGroupStyle"
android:layout_width="@dimen/priority_btn_width"
android:layout_height="wrap_content"
android:text="!" />
<com.google.android.material.button.MaterialButton
style="@style/ToggleButtonGroupStyle"
android:layout_width="@dimen/priority_btn_width"
android:layout_height="wrap_content"
android:text="!!" />
<com.google.android.material.button.MaterialButton
style="@style/ToggleButtonGroupStyle"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:text="!!!" />
</com.google.android.material.button.MaterialButtonToggleGroup>
有人可以提示我这里是什么问题吗? 谢谢:)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)