Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

how to change background color of stackview swift

extension UIStackView {
    func addBackground(color: UIColor) {
        let subView = UIView(frame: bounds)
        subView.backgroundColor = color
        subView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
        insertSubview(subView, at: 0)
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #change #background #color #stackview #swift
ADD COMMENT
Topic
Name
9+9 =