修改在手机信息页面,复制短信后,键盘按钮不存在, 背景也不存在
This commit is contained in:
@@ -95,6 +95,10 @@
|
|||||||
[self.keyboardView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.keyboardView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.top.equalTo(self.topBar.mas_bottom).offset(barSpacing);
|
make.top.equalTo(self.topBar.mas_bottom).offset(barSpacing);
|
||||||
}];
|
}];
|
||||||
|
// 首次创建时立即生成按键,避免只出现 4 行容器但按键未渲染的情况。
|
||||||
|
[self.keyboardView reloadKeys];
|
||||||
|
// 同步应用一次主题,确保键盘背景与按键皮肤在首帧可见。
|
||||||
|
[self kb_applyTheme];
|
||||||
// 功能面板切换交由外部控制器处理;此处不直接创建/管理
|
// 功能面板切换交由外部控制器处理;此处不直接创建/管理
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
selector:@selector(kb_undoStateChanged)
|
selector:@selector(kb_undoStateChanged)
|
||||||
|
|||||||
@@ -125,6 +125,39 @@ static const CGFloat kKBLettersRow2EdgeSpacerMultiplier = 0.5;
|
|||||||
[self buildRow:self.row2 withRowConfig:rows[1]];
|
[self buildRow:self.row2 withRowConfig:rows[1]];
|
||||||
[self buildRow:self.row3 withRowConfig:rows[2]];
|
[self buildRow:self.row3 withRowConfig:rows[2]];
|
||||||
[self buildRow:self.row4 withRowConfig:rows[3]];
|
[self buildRow:self.row4 withRowConfig:rows[3]];
|
||||||
|
|
||||||
|
NSUInteger totalButtons = [self kb_totalKeyButtonCount];
|
||||||
|
if (totalButtons == 0) {
|
||||||
|
NSLog(@"[KBKeyboardView] config layout produced no keys, fallback to legacy.");
|
||||||
|
for (UIView *row in @[self.row1, self.row2, self.row3, self.row4]) {
|
||||||
|
[row.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
|
||||||
|
}
|
||||||
|
[self kb_buildLegacyLayout];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)didMoveToWindow {
|
||||||
|
[super didMoveToWindow];
|
||||||
|
if (!self.window) { return; }
|
||||||
|
if ([self kb_totalKeyButtonCount] > 0) { return; }
|
||||||
|
// 兜底:系统编辑菜单切出切回等场景下,若按键丢失则自动重建。
|
||||||
|
[self reloadKeys];
|
||||||
|
// 自动重建后再触发一次上层主题应用,避免“按键恢复了但皮肤背景没恢复”。
|
||||||
|
UIView *container = self.superview;
|
||||||
|
if ([container respondsToSelector:@selector(kb_applyTheme)]) {
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
|
||||||
|
[container performSelector:@selector(kb_applyTheme)];
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSUInteger)kb_totalKeyButtonCount {
|
||||||
|
NSUInteger total = 0;
|
||||||
|
for (UIView *row in @[self.row1, self.row2, self.row3, self.row4]) {
|
||||||
|
total += [self kb_collectKeyButtonsInView:row].count;
|
||||||
|
}
|
||||||
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Hit Test
|
#pragma mark - Hit Test
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ static void KBMaiPoint_DebugLogError(NSURLResponse *response, NSError *error) {
|
|||||||
@"eventId": trimmedName,
|
@"eventId": trimmedName,
|
||||||
@"value": val.copy
|
@"value": val.copy
|
||||||
};
|
};
|
||||||
// [self postPath:KB_MAI_POINT_PATH_GENERIC_DATA parameters:params completion:completion];
|
[self postPath:KB_MAI_POINT_PATH_GENERIC_DATA parameters:params completion:completion];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)reportPageExposureWithEventName:(NSString *)eventName
|
- (void)reportPageExposureWithEventName:(NSString *)eventName
|
||||||
|
|||||||
Reference in New Issue
Block a user