react-native - 在共享元素转换期间更改字体大小 [REACT-NATIVE]
问题描述
我正在使用 react-navigation-shared-element 开发一个 react-native 应用程序,当字体大小在共享元素转换期间,它似乎不起作用。我的意思是当文本的行从 2 变为 1 时会出现问题。这是一个视频,然后是我的代码:
https://drive.google.com/file/d/1RqCHJIl58_q3P30DSo57GwucL_mjH-GY/view?usp=sharing
// Thumbnail.js
<SharedElement
id={`story.${story.id}.title`}
style={{
position: "absolute",
bottom: 16,
zIndex: 3,
alignSelf: "flex-start",
}}
>
<Text
numberOfLines={2}
style={{ fontSize: 20, alignSelf: "flex-start" }}
>
{story.title}
</Text>
</SharedElement>
// Story.js
<SharedElement
id={`story.${story.id}.title`}
style={{ position: "absolute", bottom: 100, alignSelf: "flex-start" }}
>
<Text
numberOfLines={2}
style={{ fontSize: 30, alignSelf: "flex-start" }}
>
{story.title}
</Text>
</SharedElement>
解决方案
推荐阅读
- android - 更新列表时 TypeConverter 不起作用
在房间数据库 - python - TypeError:类型'type'的参数在python中不可迭代
- google-cloud-firestore - Firestore 和 Angularfire2:它是 array-contains 还是 array_contains?
- git - 如何在 Linux 上使用 Github 2FA 和 VSCode?
- typescript - 如何在打字稿中键入函数引用
- php - 通过带有 PDO 页面的会话变量将登录 ID 传递到另一个页面
- javascript - 包含 promise 调用的函数中的参数范围
- c# - Json 反序列化错误。不支持的类型:System.Guid
- postgresql - 我可以将自己的 UDF 作为内置函数添加到 PostgreSQL 吗?
- c# - ASP.NET MVC - Kendo Grid 缓慢分页