【发布时间】:2019-09-24 15:29:56
【问题描述】:
当我想使用 drawableLeft/Right 等带有按钮的 Activity Theme.MaterialComponents.... 时,它们不会显示。但是,如果我使用主题 Base.Theme.AppCompat,它们会按预期工作。
这是按钮:
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Test Button"
android:drawableLeft="@drawable/ic_envelope"/>
这就是主题Base.Theme.MaterialComponents的外观
如何使drawableLeft 与Base.Theme.MaterialComponents 主题一起使用?
【问题讨论】:
-
使用
com.google.android.material.button.MaterialButton和app:iconGravity和app:icon -
谢谢,这行得通!
标签: android material-design android-button material-components-android material-components