玩具熊回家路

最后更新于 2023年06月08日

分类: 喜剧 地区: 捷克 年份:2010 

状态:HD高清

类型:喜剧 家庭 

导演:扬·斯维拉克 

主演:兹旦内克·斯维拉克/帕沃·里斯卡/Jirí·Machácek/Petr·/

又名:酷奇小熊回家记/Kuky回家/库奇/Kooky

HD高清

2010/捷克/喜剧,家庭

豆瓣评分:7.1分

玩具熊回家路剧情简介

" 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) }}

猜你喜欢

世博的太阳

9.0 2024/日本/喜剧,家庭,喜剧片

黐线枕边人

1.0 1991/香港/喜剧,犯罪

浪漫主义者

4.0 2010/美国/剧情,喜剧,爱情

佐州自救兄弟

10.0 2014/美国/喜剧,动作

坠入

5.0 2006/美国/南非/印度/剧情,喜剧,奇幻,冒险