1
This commit is contained in:
@@ -500,11 +500,15 @@ edgeSpacerMultiplier:(CGFloat)edgeSpacerMultiplier {
|
||||
}];
|
||||
}
|
||||
|
||||
// 如果有左右占位,则把占位宽度设置为字符键宽度的一定倍数,以实现整体居中
|
||||
// 如果有左右占位,则把占位宽度设置为字符键宽度的一定倍数,以实现整体居中;
|
||||
// 同时强约束左右占位宽度相等,避免在某些系统上由于布局冲突导致只压缩一侧,
|
||||
// 出现“左侧有空隙,右侧无空隙”的情况。
|
||||
if (leftSpacer && rightSpacer) {
|
||||
// 1) 左右占位宽度必须相等
|
||||
[leftSpacer mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.equalTo(firstChar).multipliedBy(edgeSpacerMultiplier);
|
||||
make.width.equalTo(rightSpacer);
|
||||
}];
|
||||
// 2) 同时都接近字符键宽度的 edgeSpacerMultiplier 倍数
|
||||
[rightSpacer mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.equalTo(firstChar).multipliedBy(edgeSpacerMultiplier);
|
||||
}];
|
||||
|
||||
@@ -276,6 +276,18 @@
|
||||
#pragma mark - Network check & alert
|
||||
|
||||
- (void)kb_checkNetworkAndShowAlertIfNeeded {
|
||||
// 首次安装且尚未完成首页引导时,不弹“无网络”提示,避免在系统蜂窝数据权限弹窗前就打扰用户
|
||||
static NSString *const kKBHasLaunchedOnce = @"KBHasLaunchedOnce";
|
||||
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
|
||||
if (![ud boolForKey:kKBHasLaunchedOnce]) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 仅在应用处于前台时提示
|
||||
if ([UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
AFNetworkReachabilityStatus status = [AFNetworkReachabilityManager sharedManager].networkReachabilityStatus;
|
||||
|
||||
// 只有在“明确不可达”时才弹
|
||||
|
||||
Reference in New Issue
Block a user