#import "CustomView.h"
@interface CustomView(Private)
@property (nonatomic, weak) IBOutlet UIButton *btnNew;
@property (nonatomic, weak) IBOutlet UIButton *btnEdit;
@property (nonatomic, weak) IBOutlet UIButton *btnDelete;
@property (nonatomic, weak) IBOutlet UIButton *btnCancel;
@end
@implementation CustomView
+ (CustomView *)instanceWithFrame:(CGRect)frame
{
CustomView *view = (CustomView *)[[NSBundle mainBundle] loadNibNamed:@"CustomViewXib" owner:nil options:nil][0];
view.frame = frame;
return view;
}
//1
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
}
return self;
}
//2
- (void)awakeFromNib {
[super awakeFromNib];
}
//3
- (void)willMoveToSuperview:(UIView *)newSuperview {
if (newSuperview) {
}
}
//4
- (void)layoutSubviews {
[super layoutSubviews];
}
@end
iOS: xib自定义view的模版小记
最新推荐文章于 2020-08-12 15:56:43 发布