优化发送输入框

This commit is contained in:
2026-02-02 21:25:28 +08:00
parent 6e50cdcd2a
commit 19cb29616f
9 changed files with 126 additions and 63 deletions

View File

@@ -791,7 +791,7 @@
- (UIButton *)sendButton {
if (!_sendButton) {
_sendButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_sendButton setTitle:KBLocalized(@"发送") forState:UIControlStateNormal];
[_sendButton setTitle:KBLocalized(@"send") forState:UIControlStateNormal];
[_sendButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_sendButton.titleLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
_sendButton.backgroundColor = [UIColor colorWithRed:0.2 green:0.6 blue:1.0 alpha:1.0];

View File

@@ -23,7 +23,7 @@
@property (nonatomic, strong) JXCategoryListContainerView *listContainerView;
///
@property (nonatomic, strong) UIButton *searchButton;
//@property (nonatomic, strong) UIButton *searchButton;
///
@property (nonatomic, strong) NSArray<NSString *> *titles;
@@ -42,7 +42,7 @@
[self setupUI];
/// 2
[self bindActions];
// [self bindActions];
}
#pragma mark - 1
@@ -69,12 +69,12 @@
}];
//
[self.kb_navView addSubview:self.searchButton];
[self.searchButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.kb_navView).offset(-16);
make.centerY.equalTo(self.kb_backButton);
make.width.height.mas_equalTo(24);
}];
// [self.kb_navView addSubview:self.searchButton];
// [self.searchButton mas_makeConstraints:^(MASConstraintMaker *make) {
// make.right.equalTo(self.kb_navView).offset(-16);
// make.centerY.equalTo(self.kb_backButton);
// make.width.height.mas_equalTo(24);
// }];
//
[self.view addSubview:self.listContainerView];
@@ -94,9 +94,9 @@
#pragma mark - 2
- (void)bindActions {
[self.searchButton addTarget:self action:@selector(searchButtonTapped) forControlEvents:UIControlEventTouchUpInside];
}
//- (void)bindActions {
// [self.searchButton addTarget:self action:@selector(searchButtonTapped) forControlEvents:UIControlEventTouchUpInside];
//}
#pragma mark - Actions
@@ -189,16 +189,16 @@
return _listContainerView;
}
- (UIButton *)searchButton {
if (!_searchButton) {
_searchButton = [UIButton buttonWithType:UIButtonTypeCustom];
if (@available(iOS 13.0, *)) {
UIImage *searchImage = [UIImage systemImageNamed:@"magnifyingglass"];
[_searchButton setImage:searchImage forState:UIControlStateNormal];
_searchButton.tintColor = [UIColor colorWithHex:0x1B1F1A];
}
}
return _searchButton;
}
//- (UIButton *)searchButton {
// if (!_searchButton) {
// _searchButton = [UIButton buttonWithType:UIButtonTypeCustom];
// if (@available(iOS 13.0, *)) {
// UIImage *searchImage = [UIImage systemImageNamed:@"magnifyingglass"];
// [_searchButton setImage:searchImage forState:UIControlStateNormal];
// _searchButton.tintColor = [UIColor colorWithHex:0x1B1F1A];
// }
// }
// return _searchButton;
//}
@end