我在用supportLibrary =“28.0.0-beta01”版本。
这是我在 .xml 文件中的代码:
<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
![enter image description here](https://i.stack.imgur.com/68OlS.png)
Edit
我不需要任何自定义视图或硬编码的东西。如果这是一个错误(应用程序:iconGravity),我将等待下一个版本。
EDIT
版本中修复的bug28.0.0-rc01,只需更改版本即可。
您原始问题中的代码片段是正确的。这已被确定为一个错误,并将在即将发布的版本中修复。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)