android:textSize 在 MotionLayout 中的变化 [英] android:textSize change in MotionLayout

查看:31
本文介绍了android:textSize 在 MotionLayout 中的变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将使用 MotionLayout 为文本大小更改设置动画.

I am going to animate text size change using MotionLayout.

我为开始状态执行以下操作

I do the following for start state

<CustomAttribute
    motion:attributeName="textSize"
    motion:customDimension="16sp" />

以下是结束状态

<CustomAttribute
    motion:attributeName="textSize"
    motion:customDimension="14sp" />

因此,看起来大小实际上在变化,但比 14sp-16sp 大得多

As a result, it looks like size is actually changing, but it's much larger than 14sp-16sp

那么,如何正确改变文字大小?

So, how to change text size properly?

推荐答案

试试这个

<CustomAttribute
    motion:attributeName="textSize"
    motion:customFloatValue="14" />

这篇关于android:textSize 在 MotionLayout 中的变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆