当前位置: 首页 喜剧 玩具熊回家路
手机观看

玩具熊回家路 (2010)

2010/捷克/ 喜剧 家庭

HD高清

剧情简介

" let dic = ToolsHelper.parserRichText(txt: storyText) DispatchQueue.main.async { self.richTextBox.attributedText = dic["attributedText"] as? NSAttributedString self.contentHeight = dic["height"] as? CGFloat ?? 0 self.contentWidth = dic["width"] as? CGFloat ?? 0 self.updateAttributedString() } } let tag = 200 DispatchQueue.global().asyncAfter(deadline: DispatchTime.now() 1) { let subView = self.view.viewWithTag(tag) if subView != nil { subView?.removeFromSuperview() } } } // 编辑文本 func editText(txt: String) -> Void { let tags = [RichTextTag.Bold: "strong", RichTextTag.Italic: "em", RichTextTag.Underline: "ul", RichTextTag.Deleteline: "del"] var result = "" var otherTxt = txt for item in tags.keys { var tagStart = "", tagEnd = "" if otherTxt.contains(item.begin) && otherTxt.contains(item.end) { tagStart = "<(tags[item] ?? "")>" otherTxt.components(separatedBy: item.begin)[1] tagEnd = tagStart.components(separatedBy: item.end)[0] "" tagEnd tagStart = otherTxt.components(separatedBy: item.begin)[0] tagStart tagEnd = otherTxt.components(separatedBy: item.end)[1] tagEnd } if (tagStart == "") { continue } result = tagStart otherTxt = tagEnd } result = otherTxt print(result) } // 更新AttributedString func updateAttributedString() -> Void { let attributedtext = NSMutableAttributedString(attributedString: richTextBox.attributedText) let attr = attributedtext.attributes(at: 0, longestEffectiveRange: nil, in: NSRange(location: attributedtext.length - 1, length: 1)) let b = (contentHeight 20) > self.view.frame.height let font = UIFont.systemFont(ofSize:Config.TEMPMENUSIZE (b ? -1 : 1)) let paragraphyStyle = NSMutableParagraphStyle() paragraphyStyle.lineSpacing = 5 paragraphyStyle.lineBreakMode = .byTruncatingTail attributedtext.addAttribute(.paragraphStyle, value: paragraphyStyle, range: NSRange(location: 0, length: attributedtext.length)) attributedtext.addAttribute(.font, value: font, range: NSRange(location: 0, length: attributedtext.length)) for item in attr.keys { attributedtext.removeAttribute(item, range: NSRange(location: attributedtext.length - 1, length: 1)) } let constraints = [NSLayoutConstraint(item: view, attribute: .leading, relatedBy: .equal, toItem: view, attribute: .leading, multiplier: 1, constant: 10), NSLayoutConstraint(item: view, attribute: .trailing, relatedBy: .equal, toItem: view, attribute: .trailing, multiplier: 1, constant: -10), NSLayoutConstraint(item: view, attribute: .top, relatedBy: .equal, toItem: view, attribute: .top, multiplier: 1, constant: 10), NSLayoutConstraint(item: view, attribute: .bottom, relatedBy: .equal, toItem: view, attribute: .bottom, multiplier: 1, constant: -10)] let width = view.frame.width - 20 for constraint in constraints { switch constraint.firstAttribute { case .trailing: constraint.constant = width case .leading: constraint.constant = width default:break } } view.addConstraints(constraints) }}

本站所有视频和图片均来自互联网收集而来,本网站只提供web页面服务,并不提供资源存储,也不参与录制、上传
若本站收录的节目无意侵犯了贵司版权,请发邮件至123456@test.cn (我们会在3个工作日内删除侵权内容,谢谢。)

Copyright © 2019 火豆电影网 icp123