如果我尝试使用layout_marginStart或layout_marginEnd添加边距,但对 UI 没有影响。当我将它们添加为MaterialButtonToggleGroup的子项时,我不确定为什么layout_marginStart、layout_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
如何在 kotlin 中使用带有底部工作表对话框的数据绑定。我在使用带有底部工作表对话框的数据绑定时遇到问题