nativescript - 如何在 nativescript 中设计上标
问题描述
我正在尝试显示购物车中有多少物品。在购物车符号的顶部。但我在使用网格布局时遇到了问题。因为,nativescript 不支持上标。有没有更好的设计方法。
我尝试了类似下面的东西。但商品数量未正确显示在购物车符号的右上角。
<GridLayout col="2" rows="auto" columns="*,*">
<Label col="0" text="" fontSize="28" class="fas" textWrap="true" />
<Label col="1" text="{{ line_item_no }}" fontSize="10" textWrap="true" margin="0 5 0 5" class="fcw" />
</GridLayout>
我需要一个 25 字号的购物车符号。在右上角,我需要一个被圆形背景包围的 10 字体大小的数字。请给我一些想法。
解决方案
您可以使用text-decoration: line-through;
属性,请参阅以下参考资料:
https://docs.nativescript.org/api-reference/modules/ui_enums .textdecoration https://docs.nativescript.org/ui/styling _
推荐阅读
- excel - 加快控制数据透视表的 VBA 用户表单的提示
- kubernetes - 如何手动卸载牧场主?
- node.js - 无法使用 Sequelize 连接到 GCP Postgres 数据库
- python - Python Panads,如何使用 read_excel 保留单元格值的空格?
- arrays - Free() 一个安全复制的字符串数组崩溃?
- google-apps-script - 在其他电子表格中添加行时触发功能
- vue.js - 选中 Vue 材质复选框
- android - 增强面给出了不正确的坐标
- javascript - 在 app.js 中使用创建简单的登录和 Cookie 返回 null
- python - pandas.str.findall() 返回相同值但带有减少字符的多个实例