UITableViewHeaderFooterView subclass with auto layout and section reloading won't work well together

后端 未结 11 1395
天涯浪人
天涯浪人 2020-12-30 23:04

I am trying to incorporate auto layout into my UITableViewHeaderFooterView subclass. The class is pretty basic, just two labels. This is the complete subclass:



        
11条回答
  •  感情败类
    2020-12-30 23:44

    So weird! Thanks for this @josh-bernfield, here is what I wrote for iOS 11.3:

    override var frame: CGRect {
        get {
            return super.frame
        }
        set {
            if newValue.width == 0 { return }
            super.frame = newValue
        }
    }
    

提交回复
热议问题