How do I set indepenedent height/width in collection view item
08:15 02 Dec 2025

I want to make the collection view pills like the first screenshot but the moment i scale height up the width also scales up with it, i want small height and more width kind of resembling the fatso appearance

I tried so many things but no avail, can anybody help me with this

import UIKit

class SeventhLoanCVCell: UICollectionViewCell {
    
    @IBOutlet weak var imgStatus: UIImageView!
    @IBOutlet weak var imgProgress: UIImageView!
    @IBOutlet weak var viewProgress: UIView!
    @IBOutlet weak var lblNumber: UILabel!
    
    @IBOutlet weak var imgProgressWidthCon: NSLayoutConstraint!
    override func awakeFromNib() {
        super.awakeFromNib()
        imgProgressWidthCon.constant = 28.adjustedHeight
        lblNumber.font = .appFont(.switzerSemibold, size: CGFloat(14))
    }
   
    func configureCell(for step: ProgressStep) {
        lblNumber.text = "\(step.pcNumber ?? 0)"
        lblNumber.textColor = .textColorv2
        switch step.pcColor {
        case "fullbluegreen":
            imgProgress.image = UIImage(named: "fullBlue")
            imgStatus.image = UIImage(named: "greenTickP")
            viewProgress.backgroundColor = .proBlueClr
            lblNumber.textColor = .white
            
        case "fullbluered":
            imgProgress.image = UIImage(named: "fullBlue")
            imgStatus.image = UIImage(named: "crossRedP")
            viewProgress.backgroundColor = .proGrayClr
            lblNumber.textColor = .white
        case "halfblue":
            imgProgress.image = UIImage(named: "halfBlue")
            imgStatus.image = UIImage(named: "grayTickP")
            viewProgress.backgroundColor = .proGrayClr
        case "gray":
            imgProgress.image = UIImage(named: "garyProgress")
            imgStatus.image = UIImage(named: "grayTickP")
            viewProgress.backgroundColor = .proGrayClr
        case "yellow":
            imgProgress.image = UIImage(named: "yellowPr")
            imgStatus.image = UIImage(named: "yellowGift")
            viewProgress.backgroundColor = .proGrayClr
        case "blur":
            imgProgress.image = UIImage(named: "garyProgress")
            imgStatus.image = UIImage(named: "grayTickP")
            viewProgress.backgroundColor = .proGrayClr
            lblNumber.textColor = .proBlueTxtClr
        default:
            imgProgress.image = UIImage(named: "garyProgress")
            imgStatus.image = UIImage(named: "grayTickP")
            viewProgress.backgroundColor = .proGrayClr
        }
    }
}

Image link:

UI Streak

ios arrays uicollectionview storyboard