当我将样式应用到我的按钮@style/Widget.Material3.Button
时,它将使整个布局设计消失,布局不再可见。
这是我的XML代码。
<Button
style="@style/Widget.Material3.Button"
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="60dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="60dp"
android:text="Text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textField" />
有什么办法解决这个渲染问题吗?
发布于 2022-10-19 14:23:30
对于材料样式,您需要使用材料组件。com.google.android.material.button.MaterialButton
发布于 2022-10-28 16:24:16
转到主题并将样式的父元素更改为:
https://stackoverflow.com/questions/74126592
复制相似问题