ios16系统桌面app名字颜色?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ios16系统桌面app名字颜色?相关的知识,希望对你有一定的参考价值。

这app字体颜色为啥有时是白色,有时是黑色,是根据什么规律系统自动变化的?难道是天气影响?

参考技术A 在设置里,找到显示与亮度,点进去会出现,外观。外观里有浅色与深色,你现在说的黑色应该是深色。再选回浅色,就是白色的了.通用——辅助功能——显示调节——反转颜色——打开智能反转即可,这个时候你的主题基本上就变为黑色的了。

UIStatusBar iOS上状态栏的自定义颜色

App启动时状态栏控制

App启动的时候系统加载需要一定的时间,可以给App提供了Launch Image或Launch Screen以增强用户体验。在启动页显示出来的时候App还没有运行,也就谈不上在程序中控制状态栏的字体颜色、显示或隐藏。
默认情况下状态栏是显示出来的,并且Style为UIStatusBarStyleDefault,即黑色。

1、隐藏

可以在Info中将Status bar is initially hidden(UIStatusBarHidden)对应的Value设置为Yes。
技术分享
也可以在General中将Hide status bar勾选:
技术分享
实际上,上面两种设置方法最终作用到info.plist文件。可以直接修改该文件,如果不嫌麻烦又不担心出错的话。如果没有使用基于ViewController的状态栏控制,并且App内部又需要将状态栏显示出来,可以在AppDelegate中设置:[[UIApplication sharedApplication] setStatusBarHidden:NO];

2、设置字体颜色为白色

可以在Info中将Status bar style(UIStatusBarStyle)对应的Value设置为UIStatusBarStyeLightContent。
技术分享
也可以在General中将Status Bar style选择为Light:
技术分享
同样的,上面两种设置方法最终作用到info.plist文件。如果没有使用基于ViewController的状态栏控制,并且App内部又需要将状态栏颜色改为黑色,可以在AppDelegate中设置:
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];

App运行时状态栏控制

新建一个Xcode项目,App默认是基于ViewController的状态栏控制,即在ViewController重载prefersStatusBarHidden、preferredStatusBarStyle和preferredStatusBarUpdateAnimation三个方法,及在必要时调用setNeedsStatusBarAppearanceUpdate方法。
如果要使用iOS7之前的通过UIApplication控制状态栏,需在target的info.plist中增加一条View controller-based status bar appearance(UIViewControllerBasedStatusBarAppearance)并设置为NO。
 

1、View controller-based status bar appearance : YES 或 info.plist无此条目

 
UIViewController方法 说明
- (BOOL)prefersStatusBarHidden NS_AVAILABLE_IOS(7_0); // Defaults to NO 询问是否隐藏状态栏。
- (UIStatusBarStyle)preferredStatusBarStyle NS_AVAILABLE_IOS(7_0); // Defaults to UIStatusBarStyleDefault 询问状态栏样式(UIStatusBarStyleDefault/UIStatusBarStyleLightContent)。
// Override to return the type of animation that should be used for status bar changes for this view controller. This currently only affects changes to prefersStatusBarHidden.
- (UIStatusBarAnimation)preferredStatusBarUpdateAnimation NS_AVAILABLE_IOS(7_0); // Defaults to UIStatusBarAnimationFade
询问状态栏显示或隐藏动画。
// This should be called whenever the return values for the view controller‘s status bar attributes have changed. If it is called from within an animation block, the changes will be animated along with the rest of the animation block.
- (void)setNeedsStatusBarAppearanceUpdate NS_AVAILABLE_IOS(7_0);
设置需要更新状态栏。主动调用该方法,将间接调用上述三个方法。如果需要动画生效,需:
    [UIView animateWithDuration:0.4
                     animations:^{
                         [self setNeedsStatusBarAppearanceUpdate];
                     }];
   
 

2、View controller-based status bar appearance : NO 

 
UIApplication方法/属性 说明
// Setting statusBarHidden does nothing if your application is using the default UIViewController-based status bar system.
@property(nonatomic,getter=isStatusBarHidden) BOOL statusBarHidden;
- (void)setStatusBarHidden:(BOOL)hidden withAnimation:(UIStatusBarAnimation)animation NS_AVAILABLE_IOS(3_2);
设置是否隐藏状态栏。
// Setting statusBarHidden does nothing if your application is using the default UIViewController-based status bar system.
@property(nonatomic) UIStatusBarStyle statusBarStyle; // default is UIStatusBarStyleDefault
- (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle animated:(BOOL)animated;
设置状态栏样式(UIStatusBarStyleDefault/UIStatusBarStyleLightContent)。
   
 
如果要在App启动时和运行时全程隐藏状态栏,在View controller-based status bar appearance为NO的情况下,只需简单将Status bar is initially hidden(UIStatusBarHidden)设置为YES。
 
可以根据是否是基于ViewController的状态栏控制来决定是否调用UIApplication中控制状态栏的相关方法,也可以直接调用。因为在基于ViewController的状态栏控制时,调用UIApplication中控制状态栏的相关设置方法会被忽略。

 

以上是关于ios16系统桌面app名字颜色?的主要内容,如果未能解决你的问题,请参考以下文章

系统苹果 iOS 14发布:新增桌面小组件画中画APP资源库 | iOS14更新列表出炉,你的手机支持吗?

ios16桌面图标转盘效果

16.iOS APP图标和启动画面尺寸

苹果手机桌面时间显示设置

Android 4.0 Launcher2源码分析——主布局文件(转)

Android----获得当前应用包名当前activity的名字推断是否是系统桌面service类