ElaWorkshop / TagListView

Simple and highly customizable iOS tag list view, in Swift.
MIT License
2.64k stars 492 forks source link

Horizontal Scroll #200

Open syedrazackimran opened 5 years ago

syedrazackimran commented 5 years ago

hi, i tried to integrate horizontally in a single line, but i'm getting two line of tags

here i send code check it once

screen shot 2018-09-20 at 2 08 50 pm

private func configTagView() { tagListView = TagListView() tagListView.paddingX = 5 tagListView.paddingY = 5 tagListView.alignment = .left for (_,element) in tagArray.enumerated() { tagListView.addTag(element) } var width: CGFloat = 0 for ( _,tagView ) in tagListView.tagViews.enumerated() { width = width + tagView.intrinsicContentSize.width } tagListView.frame = CGRect(x: 0, y: 5, width: width, height: 0) tagListView.textFont = UIFont(name: applicationFontname.medium, size: 12)! tagListView.textColor = applicationsColor.mainBGColor.hexColor tagListView.selectedTextColor = .white tagListView.enableRemoveButton = false tagListView.tagSelectedBackgroundColor = applicationsColor.mainBGColor.hexColor tagListView.tagBackgroundColor = .white tagListView.cornerRadius = 2 self.tagScrollView.addSubview(tagListView) self.tagScrollView.showsVerticalScrollIndicator = false self.tagScrollView.showsHorizontalScrollIndicator = false self.tagScrollView.contentSize = CGSize(width: tagListView.frame.width, height: self.tagScrollView.bounds.height) self.tagScrollView.contentInset = UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 10) }