修改国际化

This commit is contained in:
2025-12-26 14:38:29 +08:00
parent f24750458a
commit 6713f36387
7 changed files with 31 additions and 63 deletions

View File

@@ -22,8 +22,8 @@ NS_ASSUME_NONNULL_BEGIN
/// 点击键盘 return 或右侧按钮时回调
@property (nonatomic, copy) void(^onSearch)(NSString *keyword);
/// 占位文字默认“Themes”
@property (nonatomic, copy) NSString *placeholder;
///// 占位文字默认“Themes”
//@property (nonatomic, copy) NSString *placeholder;
/// 外部可设置关键字
- (void)updateKeyword:(NSString *)keyword;

View File

@@ -9,7 +9,7 @@
@interface KBSearchBarView () <UITextFieldDelegate>
@property (nonatomic, strong) UIView *bgView; //
@property (nonatomic, strong, readwrite) UITextField *textField; //
@property (nonatomic, strong) UITextField *textField; //
@property (nonatomic, strong) UIButton *searchButton; //
@end
@@ -90,7 +90,7 @@
_textField.textColor = [UIColor colorWithHex:0x1B1F1A];
_textField.clearButtonMode = UITextFieldViewModeWhileEditing;
_textField.returnKeyType = UIReturnKeySearch;
_textField.placeholder = @"Themes"; //
_textField.placeholder = KBLocalized(@"Search Themes");
//
UIView *pad = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 8, 8)];
@@ -105,7 +105,7 @@
if (!_searchButton) {
_searchButton = [UIButton buttonWithType:UIButtonTypeSystem];
_searchButton.titleLabel.font = [KBFont regular:14];
[_searchButton setTitle:@"Search" forState:UIControlStateNormal];
[_searchButton setTitle:KBLocalized(@"Search") forState:UIControlStateNormal];
// 绿
[_searchButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_searchButton.backgroundColor = [UIColor colorWithRed:0.15 green:0.72 blue:0.62 alpha:1.0];
@@ -118,10 +118,10 @@
#pragma mark - Public
- (void)setPlaceholder:(NSString *)placeholder {
_placeholder = [placeholder copy];
self.textField.placeholder = placeholder;
}
//- (void)setPlaceholder:(NSString *)placeholder {
// _placeholder = [placeholder copy];
// self.textField.placeholder = placeholder;
//}
- (void)setBgCornerRadius:(CGFloat)bgCornerRadius {
_bgCornerRadius = bgCornerRadius;