代码之家  ›  专栏  ›  技术社区  ›  solenoid

UIStatusBar过渡动画--仅更改Alpha

  •  0
  • solenoid  · 技术社区  · 9 年前

    我正在尝试在过渡期间使UIStatusBar淡出,并在完成时淡入。(这纯粹是风格上的-我有一个来自顶部的转换,至少对我来说,在UIStatusBar下运行看起来很不协调)

    有没有办法不删除UIStatusBar,而只创建整个view.layer。α=0.0?

    iOS9.2和;Swift2银行代码

    1 回复  |  直到 9 年前
        1
  •  1
  •   David Yang Liu    9 年前

    不要认为这是可能的,苹果似乎正在进行基于控制器的状态栏控件的推送查看,并降低所有api的价格,以手动更改状态栏状态。我真的希望在下一届WWDC中,他们会推出替代品。由于需要更改状态栏颜色/样式的自定义转换,我的应用程序也面临同样的问题。

    @property(nonatomic,getter=isProximitySensingEnabled) BOOL proximitySensingEnabled NS_DEPRECATED_IOS(2_0, 3_0) __TVOS_PROHIBITED; // default is NO. see UIDevice for replacement
    - (void)setStatusBarHidden:(BOOL)hidden animated:(BOOL)animated NS_DEPRECATED_IOS(2_0, 3_2) __TVOS_PROHIBITED; // use -setStatusBarHidden:withAnimation:
    
    // Explicit setting of the status bar orientation is more limited in iOS 6.0 and later.
    @property(readwrite, nonatomic) UIInterfaceOrientation statusBarOrientation NS_DEPRECATED_IOS(2_0, 9_0, "Explicit setting of the status bar orientation is more limited in iOS 6.0 and later") __TVOS_PROHIBITED;
    - (void)setStatusBarOrientation:(UIInterfaceOrientation)interfaceOrientation animated:(BOOL)animated NS_DEPRECATED_IOS(2_0, 9_0, "Explicit setting of the status bar orientation is more limited in iOS 6.0 and later") __TVOS_PROHIBITED;
    
    // Setting the statusBarStyle does nothing if your application is using the default UIViewController-based status bar system.
    @property(readwrite, nonatomic) UIStatusBarStyle statusBarStyle NS_DEPRECATED_IOS(2_0, 9_0, "Use -[UIViewController preferredStatusBarStyle]") __TVOS_PROHIBITED;
    - (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle animated:(BOOL)animated NS_DEPRECATED_IOS(2_0, 9_0, "Use -[UIViewController preferredStatusBarStyle]") __TVOS_PROHIBITED;
    
    // Setting statusBarHidden does nothing if your application is using the default UIViewController-based status bar system.
    @property(readwrite, nonatomic,getter=isStatusBarHidden) BOOL statusBarHidden NS_DEPRECATED_IOS(2_0, 9_0, "Use -[UIViewController prefersStatusBarHidden]") __TVOS_PROHIBITED;
    - (void)setStatusBarHidden:(BOOL)hidden withAnimation:(UIStatusBarAnimation)animation NS_DEPRECATED_IOS(3_2, 9_0, "Use -[UIViewController prefersStatusBarHidden]") __TVOS_PROHIBITED;
    
    - (BOOL)setKeepAliveTimeout:(NSTimeInterval)timeout handler:(void(^ __nullable)(void))keepAliveHandler NS_DEPRECATED_IOS(4_0, 9_0, "Please use UIRemoteNotificationTypeVoIP remote notifications for VoIP applications") __TVOS_PROHIBITED;
    - (void)clearKeepAliveTimeout NS_DEPRECATED_IOS(4_0, 9_0, "Please use UIRemoteNotificationTypeVoIP remote notifications for VoIP applications") __TVOS_PROHIBITED;