我注意到Xcode严重影响了我的计算机性能.我只能让Xcode一次打开几分钟,然后我打开的所有内容开始变慢,电脑开始过热.当我检查活动监视器时,通常有5-15行说"com.apple.dt.Xcode.sourcecontrol.Git".有时我的应用程序不会通过登录页面,直到我强行退出它们.有没有人遇到过这个?是否有任何设置可以更改以停止此操作?
有谁知道如何在一个字符串中实现两个不同的文本对齐?
这就是我想要textView显示的内容:
label value
Run Code Online (Sandbox Code Playgroud)
我的代码:
let txtView = cell.viewWithTag(77) as! UITextView
let leftStyle = NSMutableParagraphStyle()
leftStyle.alignment = NSTextAlignment.Left
let rightStyle = NSMutableParagraphStyle()
rightStyle.alignment = NSTextAlignment.Right
let attText = NSMutableAttributedString(string: "label", attributes: [NSParagraphStyleAttributeName: leftStyle])
attText.appendAttributedString(NSAttributedString(string: " "))
attText.appendAttributedString(NSAttributedString(string: "value", attributes: [NSParagraphStyleAttributeName: rightStyle]))
txtView.attributedText = attText
Run Code Online (Sandbox Code Playgroud)
我得到的是:
label value
Run Code Online (Sandbox Code Playgroud)
任何帮助表示赞赏!:)