在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:YXJTagView开源软件地址:https://gitee.com/EasySwift/YXJTagView开源软件介绍:YXJTagView及其强大的标签框架,不仅可以填充文字,任意视图都可以。 Join Us为了更好的完善EasySwift框架,希望更多对此框架有兴趣的朋友一起加入进来打造最好用最全面扩展最好的swift框架。EasySwift官方QQ群:542916901 Mark先更新Github上的项目,所以最新的项目一定在Github上。 Features
ScreenShotSystem RequirementsiOS 8.0 or above InstallationAs a CocoaPods DependencyAdd the following to your Podfile: pod 'YXJTagView' VersionV0.0.1 ---- 2016-7-3
Exampleimport UIKitimport YXJTagViewclass ViewController: UIViewController, YXJTagViewDelegate {private var tagView: YXJTagView!override func viewDidLoad() { super.viewDidLoad() self.tagView = YXJTagView(frame: CGRect(x: 0, y: 100, width: self.view.frame.size.width, height: 20)) self.view.addSubview(tagView) tagView.title = "标题" tagView.textColor = UIColor.grayColor() tagView.textBackgorund = UIColor.grayColor().colorWithAlphaComponent(0.6) tagView.selecteColor = UIColor.redColor() tagView.horizontalSpace = 10.0 tagView.verticalSpace = 5.0 tagView.margin = 15.0 tagView.delegate = self // 场景一,纯文字// tagView.textData = ["aa", "bbb", "cccc", "ddddd", "eeeeee", "fffffff", "gggggggg"] // 场景二,纯图片// tagView.imageData = [UIImage.init(named: "1")!, UIImage.init(named: "2")!, UIImage.init(named: "3")!, UIImage.init(named: "4")!, UIImage.init(named: "5")!] // 场景三,纯图片加自定义图片大小// tagView.imageData = [UIImage.init(named: "1")!, UIImage.init(named: "2")!, UIImage.init(named: "3")!, UIImage.init(named: "4")!, UIImage.init(named: "5")!]// tagView.imageSize = CGSizeMake((self.view.frame.size.width - 60) / 2, (self.view.frame.size.width - 60) / 2 * (110 / 280)) // 场景四,任意视图,颜色必须设置为可见颜色// tagView.viewData = viewData()// tagView.textBackgorund = UIColor.clearColor()// tagView.selecteColor = UIColor.whiteColor().colorWithAlphaComponent(0.6) // 场景五,任意视图,自定义大小,颜色必须设置为可见颜色 tagView.viewData = viewData() tagView.viewSize = CGSizeMake((self.view.frame.size.width - 60) / 2, 80) tagView.textBackgorund = UIColor.clearColor() tagView.selecteColor = UIColor.whiteColor().colorWithAlphaComponent(0.6) tagView.setupUI()}func viewData() -> [UIView] { var views = [UIView]() let v1 = UIView.init(frame: CGRect(x: 0, y: 0, width: 80, height: 80)) v1.backgroundColor = UIColor.brownColor() views.append(v1) let img1 = UIImageView.init(frame: CGRect(x: 0, y: 0, width: 80, height: 80)) img1.image = UIImage.init(named: "1") v1.addSubview(img1) let v2 = UIView.init(frame: CGRect(x: 0, y: 0, width: 80, height: 80)) v2.backgroundColor = UIColor.brownColor() views.append(v2) let img2 = UIImageView.init(frame: CGRect(x: 0, y: 0, width: 80, height: 80)) img2.image = UIImage.init(named: "2") v2.addSubview(img2) let v3 = UIView.init(frame: CGRect(x: 0, y: 0, width: 80, height: 80)) v3.backgroundColor = UIColor.brownColor() views.append(v3) let img3 = UIImageView.init(frame: CGRect(x: 0, y: 0, width: 80, height: 80)) img3.image = UIImage.init(named: "3") v3.addSubview(img3) return views}func didClickView(text: String, index: Int) { print("index \(index)") print("text \(text)")}override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning()}} 极致框架
LicenseYXJTagView is licensed under the Apache License, Version 2.0 License. For more information, please see the LICENSE file. |
请发表评论