Light's Blog

The best or nothing.

iOS知识小集-171120

| Comments

iOS 10.3之后删除线失效解决办法

iOS 10.3之前写法:

1
2
3
4
[attr addAttributes:@{
    NSStrikethroughStyleAttributeName: @(NSUnderlineStyleSingle)
  }
              range:NSMakeRange(0, string.length)];

iOS 10.3之后写法:

1
2
3
4
5
[attr addAttributes:@{
    NSStrikethroughStyleAttributeName: @(NSUnderlineStyleSingle),
    NSBaselineOffsetAttributeName: @(NSUnderlineStyleNone)
  }
              range:NSMakeRange(0, string.length)];

设置状态栏style

info.plist文件中设置View controller-based status bar appearanceYES
在对应ViewController中添加下面的方法:

1
2
3
- (UIStatusBarStyle)preferredStatusBarStyle {
  return UIStatusBarStyleLightContent;
}

Comments