草庐IT

UIAppearance

全部标签

ios - 在 iOS7 中,UIBarButtonItems 在使用 UIAppearance 代理时不遵循粗体 "Done"样式

在iOS7中,默认情况下,UIBarButtonItem使用Helvetica常规粗细字体作为样式UIBarButtonItemStylePlain,并为UIBarButtonItemStyleDone使用粗体。我的应用程序使用自定义字体,我使用UIAppearance代理来实现这一点:appearance=@{NSFontAttributeName:[UIFontfontWithName:@"ProximaNova-Regular"size:18.0]};[[UIBarButtonItemappearance]setTitleTextAttributes:appearanceforS

ios - 使用 UIAppearance 移动 UINavigationBar

我正在尝试通过UIAppearance增加UINavigationBar的高度高度本身确实发生了变化,但部分栏被设备状态栏遮住了。我想将栏向下移动22像素,使其完全可见:[[UINavigationBarappearance]setFrame:CGRectMake([[UINavigationBarappearance]frame].origin.x,22,[[UINavigationBarappearance]frame].size.width,103)];我还设置了自动调整掩码[[UINavigationBarappearance]setAutoresizingMask:UIVie

ios - 使用 UIAppearance 更改后更新导航栏

我目前正在使用UIAppearance代理自定义我的iOS应用程序的导航栏背景图像。有一个用于在触发通知的两种不同模式之间切换的按钮。此通知将再次使用代理将背景更改为不同的图像。我的问题是,只有当我转到另一个Controller并返回时,此更改才会可见。我无法强制更新Controller内的导航栏。我已经在我的MainTabBarController中试过了:-(void)onAppChangedMode:(NSNotification*)notif{APP_MODEmode=(APP_MODE)[[notifobject]integerValue];//changenavigatio

ios - 在 AppDelegate 中设置 UIButton 外观时如何更改 SafariViewController 中导航栏的色调

当在AppDelegate中设置UIButton.appearance()时,我正在尝试更改SFSafariViewController中导航栏的色调.例如:AppDelegatefuncapplication(_application:UIApplication,didFinishLaunchingWithOptionslaunchOptions:[UIApplicationLaunchOptionsKey:Any]?)->Bool{//HereistheglobalsettingthatIwanttooverrideintheSafariViewControllerUIButton

ios - 更改 UIImagePickerController 的 TintColor

我通过调用以下命令在我的应用中设置了全局tintColor:UIView.appearance().tintColor=myColor但是,相同的颜色适用于UIImagePickerController并且只有一些UI元素是彩色的:例如,太阳图标有一个自定义的tintColor而focusframe有默认的。如何不对UIImagePickerController应用全局外观配置?我提出的解决方案没有完全解决这个问题,因为inputAccessoryView仍然有自己的tintColor:window?.tintColor=myColor更新:我在启动时配置应用程序范围的tintcolo

swift - UINavigationBar.appearance().tintColor 在 Swift 中不起作用

我将一个文件从Objective_c移植到Swift,在其配置中更改了标签栏颜色:我在objective-c中使用的代码是:UIColor*barColor=[UIColorcolorWithRed:.88green:.05blue:.05alpha:1];if([self.navigationController.navigationBarrespondsToSelector:@selector(barTintColor)]){//iOS7self.navigationController.navigationBar.barTintColor=barColor;}else{[[UIN

iOS:带有 UIViewControllerBasedStatusBarAppearance 的默认状态栏样式 YES

有没有办法在保持UIViewControllerBasedStatusBarAppearance启用的同时设置默认状态栏样式?这是我正在处理的问题:几乎整个应用程序都需要使用UIStatusBarStyle.LightContent,因为导航栏的背景是深色的。最初,UIViewControllerBasedStatusBarAppearance被禁用,在Info.plist中为whiletextstatus状态栏设置了以下内容:UIStatusBarStyleUIStatusBarStyleLightContent直到我发现这个.LightContent状态栏甚至对于某些共享扩展(如F

iOS:带有 UIViewControllerBasedStatusBarAppearance 的默认状态栏样式 YES

有没有办法在保持UIViewControllerBasedStatusBarAppearance启用的同时设置默认状态栏样式?这是我正在处理的问题:几乎整个应用程序都需要使用UIStatusBarStyle.LightContent,因为导航栏的背景是深色的。最初,UIViewControllerBasedStatusBarAppearance被禁用,在Info.plist中为whiletextstatus状态栏设置了以下内容:UIStatusBarStyleUIStatusBarStyleLightContent直到我发现这个.LightContent状态栏甚至对于某些共享扩展(如F

ios - 我什么时候可以开始使用通过 UIAppearance 设置的属性?

我的View类(UIView的后代)中有一些自定义外观属性。我想根据这些属性自定义View外观,但我不能在初始化程序中执行此操作,因为使用[[MyClassappearance]setFoo:…]设置的值在那一点:@interfaceView:UIView@property(strong)UIColor*someColorUI_APPEARANCE_SELECTOR;@end@implementationView@synthesizesomeColor;//Somewhereinothercodebeforetheinitializeriscalled://[[Viewappearan

ios - 我什么时候可以开始使用通过 UIAppearance 设置的属性?

我的View类(UIView的后代)中有一些自定义外观属性。我想根据这些属性自定义View外观,但我不能在初始化程序中执行此操作,因为使用[[MyClassappearance]setFoo:…]设置的值在那一点:@interfaceView:UIView@property(strong)UIColor*someColorUI_APPEARANCE_SELECTOR;@end@implementationView@synthesizesomeColor;//Somewhereinothercodebeforetheinitializeriscalled://[[Viewappearan