1
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
@property (nonatomic, strong) UIView *bottomBar;
|
||||
@property (nonatomic, strong) UIScrollView *tabScrollView;
|
||||
@property (nonatomic, strong) UIStackView *tabStackView;
|
||||
@property (nonatomic, strong) UIButton *searchButton;
|
||||
//@property (nonatomic, strong) UIButton *searchButton;
|
||||
@property (nonatomic, strong) NSArray<UIButton *> *tabButtons;
|
||||
@property (nonatomic, strong) KBEmojiDataProvider *dataProvider;
|
||||
@property (nonatomic, copy) NSArray<KBEmojiCategory *> *categories;
|
||||
@@ -135,13 +135,13 @@
|
||||
self.bottomBar.backgroundColor = [UIColor clearColor];
|
||||
[self addSubview:self.bottomBar];
|
||||
|
||||
self.searchButton = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||
self.searchButton.layer.cornerRadius = 20;
|
||||
self.searchButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightBold];
|
||||
[self.searchButton setTitle:KBLocalized(@"Search") forState:UIControlStateNormal];
|
||||
[self.searchButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
[self.searchButton addTarget:self action:@selector(onSearch) forControlEvents:UIControlEventTouchUpInside];
|
||||
[self.bottomBar addSubview:self.searchButton];
|
||||
// self.searchButton = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||
// self.searchButton.layer.cornerRadius = 20;
|
||||
// self.searchButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightBold];
|
||||
// [self.searchButton setTitle:KBLocalized(@"Search") forState:UIControlStateNormal];
|
||||
// [self.searchButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
// [self.searchButton addTarget:self action:@selector(onSearch) forControlEvents:UIControlEventTouchUpInside];
|
||||
// [self.bottomBar addSubview:self.searchButton];
|
||||
|
||||
self.tabScrollView = [[UIScrollView alloc] init];
|
||||
self.tabScrollView.showsHorizontalScrollIndicator = NO;
|
||||
@@ -163,19 +163,20 @@
|
||||
|
||||
[self.bottomBar mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.bottom.equalTo(self);
|
||||
make.height.mas_equalTo(72);
|
||||
}];
|
||||
|
||||
[self.searchButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.bottomBar.mas_right).offset(-16);
|
||||
make.centerY.equalTo(self.bottomBar);
|
||||
make.width.mas_equalTo(84);
|
||||
make.height.mas_equalTo(40);
|
||||
}];
|
||||
|
||||
// [self.searchButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.right.equalTo(self.bottomBar.mas_right).offset(-16);
|
||||
// make.centerY.equalTo(self.bottomBar);
|
||||
// make.width.mas_equalTo(84);
|
||||
// make.height.mas_equalTo(40);
|
||||
// }];
|
||||
|
||||
[self.tabScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.bottomBar.mas_left).offset(12);
|
||||
make.right.equalTo(self.searchButton.mas_left).offset(-12);
|
||||
// make.right.equalTo(self.searchButton.mas_left).offset(-12);
|
||||
make.right.equalTo(self.bottomBar.mas_right).offset(-12);
|
||||
make.top.equalTo(self.bottomBar.mas_top).offset(8);
|
||||
make.bottom.equalTo(self.bottomBar.mas_bottom).offset(-8);
|
||||
}];
|
||||
@@ -231,7 +232,7 @@
|
||||
}
|
||||
NSMutableArray<UIButton *> *buttons = [NSMutableArray arrayWithCapacity:self.categories.count];
|
||||
[self.categories enumerateObjectsUsingBlock:^(KBEmojiCategory * _Nonnull cat, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
UIButton *btn = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
btn.tag = idx;
|
||||
btn.layer.cornerRadius = 16;
|
||||
btn.layer.masksToBounds = YES;
|
||||
@@ -319,7 +320,7 @@
|
||||
}
|
||||
|
||||
- (void)onLocalizationChanged {
|
||||
[self.searchButton setTitle:KBLocalized(@"Search") forState:UIControlStateNormal];
|
||||
// [self.searchButton setTitle:KBLocalized(@"Search") forState:UIControlStateNormal];
|
||||
[self reloadData];
|
||||
}
|
||||
|
||||
@@ -331,7 +332,7 @@
|
||||
self.collectionView.backgroundColor = [UIColor clearColor];
|
||||
self.titleLabel.textColor = theme.keyTextColor ?: [UIColor whiteColor];
|
||||
UIColor *searchColor = theme.accentColor ?: [UIColor colorWithRed:0.35 green:0.35 blue:0.95 alpha:1];
|
||||
self.searchButton.backgroundColor = searchColor;
|
||||
// self.searchButton.backgroundColor = searchColor;
|
||||
self.tabNormalColor = [UIColor colorWithWhite:1 alpha:0.08];
|
||||
self.tabSelectedColor = theme.accentColor ?: [UIColor colorWithWhite:1 alpha:0.25];
|
||||
[self updateTabHighlightStates];
|
||||
|
||||
Reference in New Issue
Block a user