How can generate the flexbox layout with button please check the attach image. Any library available? Or can make with collectionView.
Asked
Active
Viewed 1,049 times
1
-
1https://github.com/zekunyan/TTGTagCollectionView – Harshal Valanda May 23 '19 at 12:48
-
1https://github.com/ElaWorkshop/TagListView – Vikash Kumar May 23 '19 at 12:56
-
1flexbox option: https://stackoverflow.com/questions/55556049/ – kukkuz May 23 '19 at 13:09
1 Answers
0
Yes you should use a collection view, and implement this delegate function
func collectionView(_ collectionView: UICollectionView,
layout collectionViewLayout: UICollectionViewLayout,
sizeForItemAt indexPath: IndexPath) -> CGSize {
var str: String = data[indexPath.row]
let font: UIFont = /*Your Font*/
let size: CGSize = str.size(withAttributes: [NSAttributedString.Key.font: font])
return CGSize(width: size.width + 39, height: 45)

Soufian Hossam
- 487
- 5
- 16