কম্পিউটার টিউটোরিয়াল

Cocoa Touch-এ UIView-এর বর্ডার কালার এবং থিকনেস (Thickness) পরিবর্তন করার পদ্ধতি


UIView-এর বর্ডার কালার এবং মোটা (thickness) পরিবর্তন করার দুটি পদ্ধতি —

পদ্ধতি ১: সরাসরি কোডিং

backView.layer.borderWidth = 5
backView.layer.borderColor = UIColor(red: 0.09, green: 0, blue: 0.30, alpha: 1).cgColor

ফলাফল —

Cocoa Touch-এ UIView-এর বর্ডার কালার এবং থিকনেস (Thickness) পরিবর্তন করার পদ্ধতি

পদ্ধতি ২: @IBDesignable এবং @IBInspectable এক্সটেনশন

@IBDesignable class DesignableView: UIView { }

extension UIView {
    @IBInspectable var borderWidth: CGFloat {
        get { return layer.borderWidth }
        set { layer.borderWidth = newValue }
    }
    @IBInspectable var borderColor: UIColor? {
        get { if let c = layer.borderColor { return UIColor(cgColor: c) }; return nil }
        set { layer.borderColor = newValue?.cgColor }
    }
}

স্টোরিবোর্ডে লাইভ প্রিভিউ —

Cocoa Touch-এ UIView-এর বর্ডার কালার এবং থিকনেস (Thickness) পরিবর্তন করার পদ্ধতি


  1. Command Prompt-এ Background এবং Foreground Color পরিবর্তন করা

  2. Chrome-এ রঙ ও থিম পরিবর্তন করার পূর্ণাঙ্গ গাইড

  3. উইন্ডোজ ১০-এ টাস্কবার কালার পরিবর্তন: ধাপে ধাপ গাইড

  4. Windows 11 টাস্কবারের রঙ সহজে কাস্টমাইজ করুন: ধাপে ধাপে গাইড