iOS10把之前的prefs开头的URL Schemes都改成了Prefs
开头,但我们发现改了之后也不会生效,这就对了,因为这仅限于widget
使用的,如果想在app内使用,需要在前面加上app-
.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"app-Prefs:root=Bluetooth"]];
iOS10默认字体变大了,我写了个UILabel的分类,希望能有帮助。
static char *UILabelChangeKey = "UILabelChangeKey";
- (void)setChange:(BOOL)change {
objc_setAssociatedObject(self, UILabelChangeKey, @(change), OBJC_ASSOCIATION_ASSIGN);
}
-(BOOL)change{
return objc_getAssociatedObject(self, UILabelChangeKey);
}
- (instancetype)init {
self = [super init];
if (self) {
[self fitFontSize];
}
return self;
}
- (void)fitFontSize {
//self.font =[UIFont preferredFontForTextStyle: UIFontTextStyleHeadline];
if ([kSystemVersion floatValue] >= 10) {
if(!self.change) {
self.adjustsFontSizeToFitWidth = YES;
self.adjustsFontForContentSizeCategory = YES;
self.change = YES;
}
}
}
网友评论