Tag: 状态栏

UIViewController呼入状态栏问题

问题: 在通话状态栏消失之后,模式提供的视图控制器不会恢复,在顶部留下20px的空白/透明空间。 正常:没有问题 通话中:没有问题 在通话消失后: 在顶部留下20px高的空白/透明空间,显示下方的橙色视图。 但状态栏仍然存在于透明区域。 导航栏还留下状态栏的空间,其“仅20px太低的位置。 基于iOS 10 模态呈现的视图控制器 自定义模态演示 主视图控制器后面是橙色的 不使用Autolayout 当旋转到横向 ,20px呼叫栏离开,仍然留下20px的差距。 我select了在风景方向显示状态栏。 (即大多数股票应用程序) 我试着听应用程序代表: willChangeStatusBarFrame didChangeStatusBarFrame 还查看基于控制器的通知: UIApplicationWillChangeStatusBarFrame UIApplicationDidChangeStatusBarFrame 当我为上述所有四种方法logging出现视图的框架时,框架总是在(y:0)原点。 更新 视图控制器自定义模态演示 let storyboard = UIStoryboard(name: "StoryBoard1", bundle: nil) self.modalVC = storyboard.instantiateViewController(withIdentifier: "My Modal View Controller") as? MyModalViewController self.modalVC!.transitioningDelegate = self self.modalVC.modalPresentationStyle = .custom self.modalVC.modalPresentationCapturesStatusBarAppearance = true; self.present(self.modalVC!, animated: true, […]

在iOS 8的Apple Status Bar上显示UIView

我知道有一些关于这方面的问题,但没有人帮助我处理我的具体问题。 我想在整个屏幕上方显示一个自定义模式,但我想保持Apple状态栏可见。 对于模态,我使用一个UIView调暗效果,另一个用于用户将与之交互的实际视图。 然后将整个模态作为子视图添加到当前视图中并显示在前面。 本质上,我试图复制UIAlertView的行为,除了自定义视图。 这是我的一些代码: var modalView:UIView = UIView(frame: self.view.window!.bounds) modalView.backgroundColor = UIColor.blackColor().colorWithAlphaComponent(0.66) modalView.addSubview(customView) self.view.window!.addSubview(modalView) modalView.window!.windowLevel = UIWindowLevelStatusBar + 1 self.bringSubviewToFront(modalView) 上面, customView是用户与之交互的UIView 。 这很好,但由于某种原因,即使状态栏的样式设置为LightContent,Apple状态栏上的文本也会消失。 从代码中可以看出,我不会触摸状态栏。 我试图让状态栏上的文字变暗,就像屏幕的其他部分一样,现在我被卡住了。 有没有人有任何见解我如何能得到所需的行为? 任何帮助将不胜感激!

在iPhone上切换应用程序时更改状态栏颜色的问题

我想用特定的视图控制器来改变状态栏的颜色。 根据StackOverFlow的答案,我实现了它。 有一个问题 ,当在iPhone上切换应用程序时,我设置的颜色淡入淡出,回到初始状态。 没关系。 请注意状态栏。 不好。 请注意状态栏。 我无法弄清楚。 我试过的代码是: 设置statusBar.backgroundColor , UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"]; if ([statusBar respondsToSelector:@selector(setBackgroundColor:)]) { statusBar.backgroundColor = [UIColor redColor ]; } 2.将subview插入到状态栏。 UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueForKey:@"statusBar"]; UIView * backgroundColorView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 375, 20) ]; backgroundColorView.autoresizingMask = UIViewAutoresizingFlexibleWidth; backgroundColorView.backgroundColor = [UIColor redColor […]

iOS7 – 是否可以更改状态栏的颜色?

有谁知道如何改变状态栏的文字颜色? 我想要它橙色。 我不是在谈论常规的黑色或白色的颜色UIStatusBarStyleLightContent ; 或者UIStatusBarStyleBlackOpaque ; pipe他呢。

setStatusBarHidden(_:withAnimation :)在iOS 9中不推荐使用

我发现在iOS 9中, setStatusBarHidden(_:withAnimation:)现在已被弃用,文档中提到使用[UIViewController prefersStatusBarHidden]但如果我仍然想用幻灯片animation隐藏状态栏,iOS 9中的替代方法是什么?

检测用户是否在通话状态栏中

如何检测用户是否在通话或共享? 我有一个像这样的iAd子视图: _UIiAD = [[self appdelegate] UIiAD]; _UIiAD.delegate = self; [_UIiAD setFrame:CGRectMake(0,470,320,50)]; [self.view addSubview:_UIiAD];\ 当用户打电话时,它设置错误? 我如何检测这个?

即使将UIViewControllerBasedStatusBarAppearance设置为NO,状态栏也可以在iPad mini上看到

我有一个UIViewControllerBasedStatusBarAppearance设置为NO的iPhone应用程序。 不是在我testing过的任何设备上(iPhone 4,5,5s,5c,iPad 4ish)都可以看到状态栏。 除了iPad mini(第一代)之外。 使用iOS SDK是7.1。 状态栏在iPad mini 1st Gen上可见。 我期望状态栏也隐藏在这个设置上。 我甚至尝试添加[[UIApplication sharedApplication] setStatusBarHidden:NO]; didFinishLaunchingWithOptions但它没有改变任何东西。 状态栏样式也设置为“在应用程序启动过程中隐藏”。 iPad mini运行iOS 7.1。 是的,这是一个边缘案例,但我不能得到这个预期的结果。 还有一点信息:我使用的是cocos2d-iphone v2.1。 从来没有遇到过这个问题,因为我已经发布了一堆具有相同引擎的应用程序。 我开始认为这是一个与组合相关的bug:iOS 7.1和iPad mini。 这是设置:

如何更改状态栏颜色使用ios与互联网可达性快速?

我想改变我的设备状态栏的颜色,如果互联网连接比状态栏的颜色应该变成黑色,如果互联网没有连接的颜色或状态栏应该变成红色,这表明它的互联网工作与否使用SWIFT处理应用程序…帮助我

在ios 9中隐藏状态栏

你如何隐藏ios 9中的状态栏? 现在已经弃用了: [UIApplication sharedApplication] setStatusBarHidden:YES];

在通话状态栏(不能满足约束条件)

就像这个问题: 自动布局和通话状态栏和这个问题: 调整通话状态栏的大小? ,我有问题的通话状态栏搞砸了我的视图布局。 这是我的嵌套结构。 我有一个自定义模式ViewController嵌套在另一个ViewController。 每当“通话状态栏”显示(然后closures)时,就会发生以下情况: 这是一个在通话状态栏显示之前的样子: 发生错误后状态栏的背景蓝色是根视图控制器的背景颜色。 每当显示“通话状态栏”时,都会打印出以下错误信息: Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted […]