问题描述
我正在使用 supportLibrary ="28.0.0-beta01" 版本.
这是我在.xml文件中的代码:
I am using supportLibrary = "28.0.0-beta01" version.
Here is my code in .xml file:
<android.support.design.button.MaterialButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:icon="@drawable/ic_my_orders"
app:iconGravity="textStart"
android:gravity="center"/>
到我的代码图标位于按钮左侧的可绘制位置.我想将按钮设置在中间.我想达到这个结果
To my code icon of the drawable locating left side of the button. I want to set button to the center.I want to achieve this result
我不需要任何自定义视图或硬编码的东西.如果是bug(app:iconGravity),我将等待下一个版本.
I don't need to any custom views or hard coded things. If this is a bug (app:iconGravity), I will wait next release.
28.0.0-rc01 版本中修复的错误,只需更改版本即可.
The bug fixed in the version 28.0.0-rc01,just change the version.
推荐答案
原始问题中的代码段是正确的.该漏洞已被识别为漏洞,并将在即将发布的版本中修复.
The code snippet you have in your original question is correct. This has been identified as a bug and will be fixed in the upcoming release.
这篇关于如何将materialButton图标设置在中心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!