You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Nativewind部分样式在Android原生端失效,Web端正常(Solito+Expo)

Solito + Nativewind(Tailwind)Expo项目Android端样式兼容问题

我使用Solito搭配Nativewind(Tailwind)开发Expo React Native项目,有一个自定义组件包含若干子元素。该组件的样式在Web端可正常应用,但在Android原生端仅部分生效:gap-5和text-center样式不生效,bg-orange-100背景色样式正常。

代码示例:

<Custom className="gap-5 bg-orange-100 text-center">
    <StyledText>TEST</StyledText>
    <StyledTitleBig>Login Screen</StyledTitleBig>
    <...>
</Custom>

Android原生端显示效果:
Android端显示效果

Web端预期显示效果:
Web端显示效果

内容的提问来源于stack exchange,提问作者Guillem Poy

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.08 21:45:31