android - 为什么在 ANDROID 中设置单个阿拉伯字符时,阿拉伯字符表现为单独的字符?
问题描述
我对此很陌生。但我确实按照一个例子来渲染彩色字母: https ://play.nativescript.org/?template=play-ng&id=ZaGBJr
<Label class="h1">
<FormattedString>
<Span text="صُ" color="#990000" class="quran"></Span>
<Span text="مٌّۢ" color="#ffcc00" class="quran"></Span>
</FormattedString>
</Label>
但是android和iOS之间的结果是不同的。我哪里做错了?
iOS(完美):
Android(分隔字符):
解决方案
哟只需要在两者之间添加ZWJ(零宽度连接器\u200D
)。请参见下面的 hTML 示例:
<h1>
<FormattedString>
<Span style="color:#990000">صُ</Span><Span style="color:#ffcc00">مٌّۢ</Span><br><br>
<Span style="color:#990000" >صُ‍</Span><Span style="color:#ffcc00">مٌّۢ</Span>
</FormattedString>
</h1>
推荐阅读
- c++ - 编译器如何使用策略模式(在结构或类中使用重载())推断类型?
- mongodb - 存储阿波罗服务器订阅
- javascript - 对 php 文件的 Javascript XHR 发布请求:加载资源失败:服务器响应状态为 404(未找到)
- git - 如何使用 jGit 限制每个文件版本的提交次数
- sql - T-SQL 将一列转为一行
- c# - 如何通过 wpf 中的代码使用对象递归填充树视图
- qt - 如何将 QML 文件组织到嵌套文件夹中?
- sql - 无法添加或更新子行我的 sql 数据库的外键约束失败
- javascript - 使用 jsrsasign 复制 openssl 命令
- oracle - Oracle PL/SQL 和 DocuSign 授权代码授予 - 获得 400 错误请求