text-align-last css 属性 Swift 等价物 [英] text-align-last css property Swift Equivalent

查看:36
本文介绍了text-align-last css 属性 Swift 等价物的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

text-align-last"css 属性的 swift 等效项是什么?我更喜欢无代码解决方案.

What is the swift Equivalent for 'text-align-last' css property? I prefer a codeless solution.

这是我所做的和我得到的:

Here is what i have done and what i get:

最后一行(有时只有一行)左对齐,不方便.

The last line (sometimes the only one) is aligned to the left, which is inconvenient.

推荐答案

您需要将标签的文本从 Plain 更改为 Attributed,然后您可以粘贴任何字符串和对齐方式以及其他属性将保持不变.所以基本上任何可以在文字处理器应用程序上创建的文本样式都可以在这里使用.

You need to change the label's text from Plain to Attributed, then you can paste any string and the alignment, as well as other attributes, will hold. So basically any text style that can create on word processor application can be used here.

在以下示例中,我使用页面(Mac 应用程序)编辑我喜欢的文本格式并将其复制到 Xcode 中的标签文本框.

In the following example I've used pages (Mac application) to edit the text format as I liked and copied it to the label text box in Xcode.

这是运行应用程序的模拟器的图片:

Here is a picture of the simulator running the app:

这篇关于text-align-last css 属性 Swift 等价物的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆