Hal*_*lpo 5 uilabel ios uiappearance uialertcontroller
我有这个代码,UILabel当它们出现在UIAlertControllers中时会改变s 的外观:
UILabel *appearanceLabel = [UILabel appearanceWhenContainedInInstancesOfClasses:@[[UIAlertController class]]];
[appearanceLabel setAppearanceFont:kFontRegular(18)];
Run Code Online (Sandbox Code Playgroud)
但这也会影响出现在UIActivityViewControllers中的UILabels .
如何排除UILabels UIActivityViewController?
根据您的情况,您可以将自己的UIAlertController子类化并使用,而不是尝试设置/取消设置外观
UILabel *appearanceLabel = [UILabel appearanceWhenContainedInInstancesOfClasses:@[[MyAlertController class]]];
[appearanceLabel setAppearanceFont:kFontRegular(18)];
Run Code Online (Sandbox Code Playgroud)
然后当操作表打开时,它将不是您的子类,因此该规则将不适用.
| 归档时间: |
|
| 查看次数: |
729 次 |
| 最近记录: |