123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- //
- // KSWebNavView.m
- // StudentDaya
- //
- // Created by Kyle on 2021/12/27.
- // Copyright © 2021 DayaMusic. All rights reserved.
- //
- #import "KSWebNavView.h"
- @interface KSWebNavView ()
- @end
- @implementation KSWebNavView
- - (instancetype)init {
- self = [super init];
- if (self) {
- [self configUI];
- }
- return self;
- }
- - (void)configUI {
- self.backgroundColor = [UIColor whiteColor];
-
- UILabel *headLabel = [[UILabel alloc] init];
- headLabel.textColor = HexRGB(0x000000);
- headLabel.font = [UIFont systemFontOfSize:18.0f weight:UIFontWeightMedium];
- headLabel.textAlignment = NSTextAlignmentCenter;
- self.topTitleLabel = headLabel;
- [self addSubview:self.topTitleLabel];
- [self.topTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.bottom.mas_equalTo(self.mas_bottom);
- make.centerX.mas_equalTo(self.mas_centerX);
- make.left.mas_equalTo(self.mas_left).offset(70);
- make.right.mas_equalTo(self.mas_right).offset(-70);
- make.height.mas_equalTo(44);
- }];
- }
- - (void)createRightButton:(NSString *)imageName target:(id)target action:(SEL)action {
- UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeCustom];
- [rightButton setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
- [rightButton addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
- [self addSubview:rightButton];
- [rightButton mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.bottom.mas_equalTo(self);
- make.width.height.mas_equalTo(44);
- }];
- }
- /*
- // Only override drawRect: if you perform custom drawing.
- // An empty implementation adversely affects performance during animation.
- - (void)drawRect:(CGRect)rect {
- // Drawing code
- }
- */
- @end
|