处理ios18从其他app用自己键盘 拉起主app的bug
其他问题
This commit is contained in:
@@ -61,7 +61,7 @@
|
||||
|
||||
// 测试储存Token
|
||||
// [[KBAuthManager shared] saveAccessToken:@"TEST" refreshToken:nil expiryDate:[NSDate dateWithTimeIntervalSinceNow:3600] userIdentifier:nil];
|
||||
[[KBAuthManager shared] signOut];
|
||||
// [[KBAuthManager shared] signOut];
|
||||
}
|
||||
|
||||
- (void)setupTabbarAppearance{
|
||||
|
||||
@@ -138,6 +138,10 @@
|
||||
_q1Label.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_q1Label.textColor = [UIColor blackColor];
|
||||
_q1Label.text = KBLocalized(@"What are you doing?");
|
||||
// 支持点击复制
|
||||
_q1Label.userInteractionEnabled = YES;
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(kb_onTapQ1)];
|
||||
[_q1Label addGestureRecognizer:tap];
|
||||
}
|
||||
return _q1Label;
|
||||
}
|
||||
@@ -148,8 +152,29 @@
|
||||
_q2Label.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_q2Label.textColor = [UIColor blackColor];
|
||||
_q2Label.text = KBLocalized(@"I'm going to take a shower.");
|
||||
// 支持点击复制
|
||||
_q2Label.userInteractionEnabled = YES;
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(kb_onTapQ2)];
|
||||
[_q2Label addGestureRecognizer:tap];
|
||||
}
|
||||
return _q2Label;
|
||||
}
|
||||
|
||||
/// 复制统一处理
|
||||
- (void)kb_copyTextToPasteboard:(NSString *)text {
|
||||
if (text.length == 0) { return; }
|
||||
UIPasteboard.generalPasteboard.string = text;
|
||||
[KBHUD showInfo:KBLocalized(@"Copy Success")];
|
||||
}
|
||||
|
||||
/// 点击第一条示例文案
|
||||
- (void)kb_onTapQ1 {
|
||||
[self kb_copyTextToPasteboard:self.q1Label.text];
|
||||
}
|
||||
|
||||
/// 点击第二条示例文案
|
||||
- (void)kb_onTapQ2 {
|
||||
[self kb_copyTextToPasteboard:self.q2Label.text];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.cardImageView);
|
||||
make.top.equalTo(self.cardImageView).offset(84);
|
||||
make.top.equalTo(self.cardImageView).offset(KBFit(95));
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
make.centerY.equalTo(self.titleLabel);
|
||||
make.right.equalTo(self).offset(-20);
|
||||
make.height.mas_equalTo(34);
|
||||
make.width.mas_greaterThanOrEqualTo(115);
|
||||
make.width.mas_greaterThanOrEqualTo(110);
|
||||
}];
|
||||
[self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self).offset(26);
|
||||
@@ -118,7 +118,7 @@
|
||||
if (!_keyboardBtn) {
|
||||
_keyboardBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_keyboardBtn setTitle:KBLocalized(@"My Keyboard") forState:UIControlStateNormal];
|
||||
_keyboardBtn.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightSemibold];
|
||||
_keyboardBtn.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightSemibold];
|
||||
[_keyboardBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_keyboardBtn.backgroundColor = [UIColor colorWithHex:KBColorValue];
|
||||
_keyboardBtn.layer.cornerRadius = 17;
|
||||
|
||||
@@ -32,10 +32,10 @@ static NSString * const kMySkinCellId = @"kMySkinCellId";
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
|
||||
// self.title = @"My Skin"; // 标题
|
||||
|
||||
self.kb_titleLabel.text = KBLocalized(@"My skin");
|
||||
// 右上角 Editor/Cancel 使用 BaseViewController 自定义导航栏的 kb_rightButton
|
||||
self.kb_rightButton.hidden = NO;
|
||||
[self.kb_rightButton setTitle:@"Editor" forState:UIControlStateNormal];
|
||||
[self.kb_rightButton setTitle:KBLocalized(@"Editor") forState:UIControlStateNormal];
|
||||
[self.kb_rightButton removeTarget:nil action:NULL forControlEvents:UIControlEventAllEvents];
|
||||
[self.kb_rightButton addTarget:self action:@selector(onToggleEdit) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
@@ -49,13 +49,14 @@ static NSString * const kMySkinCellId = @"kMySkinCellId";
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.view).offset(KB_NAV_TOTAL_HEIGHT);
|
||||
make.left.right.equalTo(self.view);
|
||||
make.bottom.equalTo(self.view.mas_bottom);
|
||||
make.bottom.equalTo(self.bottomView.mas_top);
|
||||
}];
|
||||
|
||||
[self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(self.view);
|
||||
make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
|
||||
make.height.mas_equalTo(64);
|
||||
make.bottom.equalTo(self.view.mas_bottom);
|
||||
// 初始未编辑状态:高度为 0,不占据空间
|
||||
make.height.mas_equalTo(0);
|
||||
}];
|
||||
|
||||
// 空态视图(LYEmptyView)统一样式 + 重试按钮
|
||||
@@ -108,11 +109,21 @@ static NSString * const kMySkinCellId = @"kMySkinCellId";
|
||||
self.editingMode = !self.editingMode;
|
||||
|
||||
// 更新顶部按钮
|
||||
[self.kb_rightButton setTitle:(self.isEditingMode ? @"Cancel" : @"Editor")
|
||||
[self.kb_rightButton setTitle:(self.isEditingMode ? KBLocalized(@"Cancel") : KBLocalized(@"Editor"))
|
||||
forState:UIControlStateNormal];
|
||||
|
||||
// 控制底部栏显隐
|
||||
self.bottomView.hidden = !self.isEditingMode;
|
||||
// 根据编辑态更新底部栏高度,并保持列表底部始终贴着 bottomView 顶部
|
||||
CGFloat targetHeight = self.isEditingMode ? (KB_SAFE_BOTTOM + 44.0) : 0.0;
|
||||
// 展开前先确保可见,动画结束后再根据状态隐藏
|
||||
self.bottomView.hidden = NO;
|
||||
[self.bottomView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(targetHeight);
|
||||
}];
|
||||
[UIView animateWithDuration:0.25 animations:^{
|
||||
[self.view layoutIfNeeded];
|
||||
} completion:^(BOOL finished) {
|
||||
self.bottomView.hidden = !self.isEditingMode;
|
||||
}];
|
||||
|
||||
// 列表进入/退出多选
|
||||
self.collectionView.allowsMultipleSelection = self.isEditingMode;
|
||||
@@ -155,7 +166,8 @@ static NSString * const kMySkinCellId = @"kMySkinCellId";
|
||||
|
||||
- (void)updateBottomUI {
|
||||
NSInteger count = self.collectionView.indexPathsForSelectedItems.count;
|
||||
self.selectedLabel.text = [NSString stringWithFormat:@"Selected: %ld Skins", (long)count];
|
||||
NSString *format = KBLocalized(@"my_skin_selected_count");
|
||||
self.selectedLabel.text = [NSString stringWithFormat:format, (long)count];
|
||||
|
||||
BOOL enable = count > 0;
|
||||
self.deleteButton.enabled = enable;
|
||||
@@ -253,11 +265,12 @@ static NSString * const kMySkinCellId = @"kMySkinCellId";
|
||||
|
||||
[self.selectedLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(_bottomView).offset(16);
|
||||
make.centerY.equalTo(_bottomView);
|
||||
// 固定在安全区内的 64 高度中居中(顶部向下 32)
|
||||
make.centerY.equalTo(_bottomView.mas_top).offset(32);
|
||||
}];
|
||||
[self.deleteButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(_bottomView).offset(-16);
|
||||
make.centerY.equalTo(_bottomView);
|
||||
make.centerY.equalTo(_bottomView.mas_top).offset(32);
|
||||
make.width.mas_equalTo(92);
|
||||
make.height.mas_equalTo(36);
|
||||
}];
|
||||
@@ -270,7 +283,7 @@ static NSString * const kMySkinCellId = @"kMySkinCellId";
|
||||
_selectedLabel = [UILabel new];
|
||||
_selectedLabel.textColor = [UIColor colorWithHex:0x666666];
|
||||
_selectedLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
|
||||
_selectedLabel.text = @"Selected: 0 Skins";
|
||||
// _selectedLabel.text = @"Selected: 0 Skins";
|
||||
}
|
||||
return _selectedLabel;
|
||||
}
|
||||
@@ -278,7 +291,7 @@ static NSString * const kMySkinCellId = @"kMySkinCellId";
|
||||
- (UIButton *)deleteButton {
|
||||
if (!_deleteButton) {
|
||||
_deleteButton = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||
[_deleteButton setTitle:@"Delete" forState:UIControlStateNormal];
|
||||
[_deleteButton setTitle:KBLocalized(@"Delete") forState:UIControlStateNormal];
|
||||
_deleteButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_deleteButton.layer.cornerRadius = 18;
|
||||
_deleteButton.layer.borderWidth = 1;
|
||||
|
||||
@@ -18,8 +18,10 @@
|
||||
#define KB_UL_BASE @"https://your.domain/ul"
|
||||
#endif
|
||||
|
||||
#define KB_UL_LOGIN KB_UL_BASE @"/login"
|
||||
#define KB_UL_SETTINGS KB_UL_BASE @"/settings"
|
||||
#define KB_UL_LOGIN KB_UL_BASE @"/login"
|
||||
#define KB_UL_SETTINGS KB_UL_BASE @"/settings"
|
||||
// 充值入口的通用链接:当前复用 /login 路径,通过 query 区分(避免额外配置 AASA 路径)
|
||||
#define KB_UL_RECHARGE KB_UL_LOGIN
|
||||
|
||||
#endif /* KBConfig_h */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user