android:MotionLayout 中的 textSize 变化

标签 android android-layout android-motionlayout

我将使用 MotionLayout 为文本大小变化设置动画。

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

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

下面是结束状态

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

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

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

最佳答案

试试这个

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

关于android:MotionLayout 中的 textSize 变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58856602/

相关文章:

java - 如何通过另一个 Activity 杀死一个服务?

Android SnackBar : error inflating SnackbarLayout

java - 删除 LinearLayout 中子级之间的空间

android-motionlayout - MotionLayout 应用 loadLayoutDescription

android - MotionLayout 多个 Transitions

android - 运动布局。 OnSwipe 无法正确处理拖动事件。根本问题是什么?

android - 如何关闭或停止我在 Android 中启动的外部应用程序

android - 如何模拟系统类进行类型转换

android - Retrofit2:应为 BEGIN_ARRAY 但在第 1 行第 268 列路径 $[0].images 处为 STRING

android - 更新 Android 中 ListView 项的值