小编Bla*_*Guy的帖子

MaterialButtonToggleGroup 孩子的 MaterialButton layout_marginStart、layout_marginEnd 不起作用

如果我尝试使用layout_marginStartlayout_marginEnd添加边距,但对 UI 没有影响。当我将它们添加为MaterialButtonToggleGroup的子项时,我不确定为什么layout_marginStartlayout_marginEnd不能与MaterialButton一起使用

在此处输入图片说明

 <com.google.android.material.button.MaterialButtonToggleGroup
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginLeft="@dimen/ten_dp"
                            app:singleSelection="true">

                            <com.google.android.material.button.MaterialButton
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="@dimen/twentY"
                                app:icon="@drawable/ic_directions_walk_black_24dp" />

                            <com.google.android.material.button.MaterialButton
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="@dimen/ten_dp"

                                app:icon="@drawable/ic_directions_car_black_24dp" />

                            <com.google.android.material.button.MaterialButton
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"

                                android:layout_marginStart="@dimen/ten_dp"
                                app:icon="@drawable/ic_directions_bus_black_24dp" />
                        </com.google.android.material.button.MaterialButtonToggleGroup>
Run Code Online (Sandbox Code Playgroud)

android android-button android-togglebutton material-design material-components-android

4
推荐指数
1
解决办法
992
查看次数

使用 kotlin 在 android 中与底部工作表进行数据绑定

如何在 kotlin 中使用带有底部工作表对话框的数据绑定。我在使用带有底部工作表对话框的数据绑定时遇到问题

data-binding android mvvm kotlin

2
推荐指数
1
解决办法
6125
查看次数