android - 从材料组件上的按钮中删除等宽字体
问题描述
如何使用新材料组件从按钮中删除等宽字体?
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_register"
style="@style/Widget.MaterialComponents.Button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
app:fontFamily="@font/lato"
app:backgroundTint="@color/white"
android:textColor="?colorPrimary"
android:text="Open Register Screen" />
这张图片显示了我想要消除的差异:
解决方案
我发现了问题。它不是等宽字体,它是letterSpacing
. 所以我只是添加android:letterSpacing="0"
按钮来解决。
推荐阅读
- javascript - 未捕获的 ReferenceError:未定义变量
- javascript - 反应路由中的错误 404
- android - Android 异常:cursor.getString(cursor....ColumnIndex("bucket_id")) 不能为空
- apache-spark - 触发多个 CSV 读取?
- node.js - Loggly 子域是必需的
- python - 使用 keras 进行视觉问答的损失不收敛
- jquery - jQuery toggleClass 仅在单击的 div 之外的一个 div 上,并非都具有相同的类
- javascript - 如何将firebase auth/wrong-password显示为窗口警报?
- node.js - 运行量角器测试时出现 NPM 错误(EPERM:不允许操作)
- docker - docker中的Spark,为驱动程序/执行程序设置内存