Custom UIView's drawRect never called if initial frame is CGRectZero

后端 未结 2 2025
后悔当初
后悔当初 2021-02-13 21:14

I\'ve got a pretty simple custom subclass of UIView:

#import \"BarView.h\"
#import 

@implementation BarView

@synthesize barColor         


        
2条回答
  •  礼貌的吻别
    2021-02-13 22:12

    In Swift 5

    override init(frame: CGRect) {
          super.init(frame: frame)
    
          contentMode = UIView.ContentMode.redraw
    

提交回复
热议问题