m***@163.com
m***@163.com
  • 发布:2020-06-17 17:04
  • 更新:2020-06-19 09:32
  • 阅读:764

#插件讨论# 【 通用canvas海报库 - xlf-summer@qq.com 】水平位置问题

分类:uni-app

水平排列多个text,h5上是正常,在ios真机上text之间的间隔不对

{  
                        type: 'container',  
                        direction: "horizontal",  
                        width: 690,  
                        children: [  
                            {  
                                type: "text",  
                                color: "#fe2534",  
                                left: 30,  
                                top: 40,  
                                fontSize: 28,  
                                content: '¥'  
                            },  
                            {  
                                type: "text",  
                                color: "#fe2534",  
                                top: 30,  
                                fontSize: 28,  
                                content: this.info.zk_final_price  
                            },  
                            {  
                                type: "text",  
                                color: "#fe2534",  
                                top: 40,  
                                left: 0,  
                                fontSize: 28,  
                                content: '券后'  
                            },  
                            {  
                                type: "text",  
                                color: "#999",  
                                top: 40,  
                                left: 40,  
                                fontSize: 28,  
                                content: `¥${this.info.reserve_price}`  
                            },  
                            {  
                                type: "text",  
                                color: "#fe2534",  
                                top: 40,  
                                left: 30,  
                                fontSize: 28,  
                                content: `${this.info.coupon_info}`  
                            }  
                        ]  
                    },
2020-06-17 17:04 负责人:无 分享
已邀请:
m***@163.com

m***@163.com (作者)

图1真机效果,位置有问题,图2是h5效果,位置是正确的

x***@qq.com

x***@qq.com

是支付宝小程序还是微信小程序?

  • m***@163.com (作者)

    原生app,还有一个问题,text不支持text-decoration: line-through吗

    2020-06-19 09:44

  • x***@qq.com

    回复 m***@163.com: 是的,目前不支持,可以通过

    line + text 手动实现,line 的长度可以调用 painter.measureText 来取

    2020-06-19 10:28

  • x***@qq.com

    回复 m***@163.com: 我这没有运行 iOS 原生 App 的设备和环境,没办法帮你调试,有兴趣的话可以自己看看源码,提 PR 来修复

    2020-06-19 10:31

  • x***@qq.com

    后续讨论请移步 github

    https://github.com/xlfsummer/mp-painter/issues/19

    2020-06-19 10:34

该问题目前已经被锁定, 无法添加新回复