标签: uistatusbar

工具栏reappers后,状态栏显示在QLPreviewController中

状态栏最初隐藏在Info.plist中,"状态栏最初隐藏"设置为YES,"查看基于控制器的状态栏外观"设置为NO.

但是当我呈现一个QlPreviewController时,经过两次点击文件使工具栏消失并再次出现,状态栏也出现在应用程序中.

知道如何防止这种情况发生吗?

objective-c ios uistatusbar qlpreviewcontroller

8
推荐指数
1
解决办法
1066
查看次数

如何在设备上的前台app中显示双倍高度绿色状态栏(In-Call)?

这里有很多问题要求在后台显示红色记录条.很明显我应该使用AVAudioSession类别AVAudioSessionCategoryPlayAndRecord.我的问题是,在我的应用程序中进行有效的VOIP呼叫时,如何在前台应用程序中显示绿色的通话栏(或至少红色条)?所以我可以回到调用UI点击状态栏区域,就像Whatsapp或Skype一样.

我已经尝试过的:

  • voip在这个SO答案中建议的Info.plist + + audio中的UIBackgroundModes键和模式(在进行背景时给我一个红色状态栏,但在前景时没有任何内容)setCategory:AVAudioSessionCategoryPlayAndRecordsetActive
  • 以前的+ AVAudioSession+ setMode:AVAudioSessionModeVoiceChat- 没有用
  • kCFStreamNetworkServiceTypeVoIP在pjsip源中将标志设置为套接字并重新编译它 - 没有帮助.此外,自iOS 8以来已弃用.
  • 创建一个单独的套接字,为inputStream/outputStream设置voip标志:( [self.inputStream setProperty:NSStreamNetworkServiceTypeVoIP forKey:NSStreamNetworkServiceType]这里获取示例代码)

使用pjsip进行通话.还有什么可以尝试增加状态栏高度,将所有UI移动?有没有任何标准方法可以做到这一点,或者我应该通过调整根UIWindow并在状态栏下设置另一个绿色UIWindow来自行破解它?


编辑:由于没有找到标准方法的答案,接受@ roman-ermolov答案.对于那些会寻找答案的人,我可以建议您自己做几个选择:

  1. 将根视图控制器包装在容器中,就像Apple的iAdSuite with Storyboards示例一样.以我的示例项目为例.可能是制作那个酒吧的最佳方式.
  2. Hack UINavigationBar height(参见方法) - 尚未用于横向,但可能已经解决
  3. 自己控制主UIWindow的框架,在状态栏下放置另一个UIWindow,其中包含所需的内容.

voip pjsip ios uistatusbar in-call

8
推荐指数
1
解决办法
1227
查看次数

当应用程序进入后台时,如何创建"返回应用程序"状态栏?

当我的应用程序在播放音频或录制音频时移动到后台时,我想提供一些类似绿色的"In Call"状态栏,当您正在通话并换到另一个应用程序时,会显示给您"返回app"功能.

我认为这可能是一个私有API,但我注意到Griffin iTalk应用程序在录制音频时会这样做(见图片) - 所以我知道它可以完成,但我无法弄清楚API是什么(该Info.plist设置,AVAudioSession时,UIApplication/Delegate或别的什么),使这种神奇的发生.我的应用程序目前正在工作并在后台录制音频并且运行正常,我假设有一些地方我没有设置得到这种行为.

有人可以指向正确的文档或展示此行为的示例代码吗?(我已经搜索了音频文档并且无法找到它).

谢谢!

替代文字

iphone audio cocoa-touch recording uistatusbar

7
推荐指数
1
解决办法
3150
查看次数

iOS 7 StatusBar问题,当我使用UIImagePickerController时允许编辑

我研究相关的iOS 7状态 - Bar Maintain,但我在使用时遇到了问题UIImagePickerController.允许编辑"编辑窗口"在顶部栏显示20像素空间.

我使用的代码和第一I设置UIViewControllerBasedStatusBarAppearanceNOinfo.plist与设置委托方法:

Appdelegate.h

@property (retain, nonatomic) UIWindow *background;
Run Code Online (Sandbox Code Playgroud)

Appdelegate.m

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {

    [application setStatusBarStyle:UIStatusBarStyleLightContent];
    self.window.clipsToBounds =YES;
    self.window.frame =  CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);

    self.window.bounds = CGRectMake(0, 20, self.window.frame.size.width, self.window.frame.size.height);

    background = [[UIWindow alloc] initWithFrame: CGRectMake(0, 0, self.window.frame.size.width, 20)];
    background.backgroundColor =[UIColor redColor];
    [background setHidden:NO];
}
Run Code Online (Sandbox Code Playgroud)

在我的家庭视图控制器中没有任何效果,所以我放入了我的home viewController,一种用于更改状态栏背景颜色的方法:

-(void)viewWillLayoutSubviews{

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
    self.view.clipsToBounds = YES;
    CGRect screenRect = [[UIScreen mainScreen] bounds];
    CGFloat screenHeight = …
Run Code Online (Sandbox Code Playgroud)

uiimagepickercontroller ios uistatusbar ios7

7
推荐指数
1
解决办法
2008
查看次数

searchController和searchResultsController问题中的StatusBar:iOS 8

嗨,这是我的问题:

在我的AppDeleagate的 didFinishLaunchingWithOptions:方法我有一个方法[self configureUINavigationControllerStlyle]; 它配置状态栏和我的应用程序的所有导航栏外观(我的UINavigationController和UITabbarController在我的应用程序中一起工作).

-(void) configureUINavigationControllerStlyle {

UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;

UINavigationController *navigationController = (UINavigationController *)[tabBarController.viewControllers objectAtIndex:0];

navigationController.navigationBar.translucent = NO;

[[UINavigationBar appearance] setBarTintColor: [CustomColor getAwesomeColor:@"colorBlue3_1"]];

[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];

[[UINavigationBar appearance]  setTitleTextAttributes:@{
NSForegroundColorAttributeName : [UIColor whiteColor],
NSFontAttributeName: [UIFont fontWithName:@"AvenirNext-DemiBold" size:17.0]
 }];

[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

}
Run Code Online (Sandbox Code Playgroud)

另外在我的info.plist中我设置:查看基于控制器的状态栏外观为"NO"

一切都很好,我的应用程序中的所有控制器都有蓝色背景和白色文本颜色的状态栏.但不是uisearchcontroller和uisearchresultscontroller.

我的根TableViewController看起来像这样:

https://www.dropbox.com/s/oqcozos89x9yqhg/Screen%20Shot%202014-12-11%20at%2016.21.06.jpg?dl=0

我在我的应用程序中集成了searchController和searchResultsController.逻辑运行良好,但我不明白如何处理searchController和searchResultController中的状态栏外观.他们不使用我在AppDelegate.m文件中创建的状态栏的样式.

我的searchController和searchResultsController看起来像这样(状态栏变为白色,状态栏的文本颜色也变为白色,但我需要我的状态栏与我的主视图控制器中的颜色相同(蓝色背景和白色文本颜色).

https://www.dropbox.com/s/26skdz7gvehmwl4/Screen%20Shot%202014-12-11%20at%2016.21.16.png?dl=0

另一个错误:当我使用时

navigationController.navigationBar.translucent = NO;
Run Code Online (Sandbox Code Playgroud)

在我的AppDelegate中 - 在使用搜索控制器后从详细视图控制器返回时,它会导致我的家庭桌面视图"跳跃或拉伸".当我没有设置半透明属性时 - 没有"跳跃".

也许有人知道如何在iOS 8中使用searchController时修复状态栏颜色问题.

如果我使用默认颜色(不要对我的AppDelegate添加任何更改),一切正常,但我需要在我的应用程序中自定义状态栏颜色.

uistatusbar uisearchresultscontroller appdelegate ios8 uisearchcontroller

7
推荐指数
2
解决办法
1439
查看次数

在不改变状态栏颜色的情况下呈现视图控制器,如UIAlertController

在执行某些网络操作时,我提供了一个模态视图控制器(类似于MBProgressHUD但作为视图控制器)以防止用户交互并指示进度.

视图控制器modalPresentationStyle = .Custom使用转换委托和自定义演示控制器进行动画处理.除了动画转换动画之外,它们没有自定义动作来驱动演示文稿.

我遇到的问题是,无论何时出现视图控制器,它都会将状态栏颜色变为黑色.我可以覆盖preferredStatusBarStyle以使其始终返回.LightContent但有时这个视图控制器呈现在视图控制器上.Default,我也不想在那里更改它.基本上,我想要有相同的行为UIAlertController.

屏幕截图显示呈现的视图控制器导致黑暗状态栏内

我已尝试配置演示控制器以将呈现的视图控制器移出状态栏空间:

private class SEUIProgressControllerPresentationController: UIPresentationController {

    override func shouldPresentInFullscreen() -> Bool {
        return false
    }

    private override func frameOfPresentedViewInContainerView() -> CGRect {
        return super.frameOfPresentedViewInContainerView().insetBy(dx: 40, dy: 100)
    }

    ...
}
Run Code Online (Sandbox Code Playgroud)

这些设置会将显示控制器的顶部移出状态栏,但状态栏仍会受到影响.是否有我失踪的属性会阻止我的视图控制器更新状态栏样式?

ios uistatusbar presentviewcontroller swift uipresentationcontroller

7
推荐指数
1
解决办法
3289
查看次数

在通话中启动应用程序时,UITAbBar在屏幕下方向下推

当用户打电话时启动我的应用程序时,整个应用程序会在绿色的“电话”栏下方被下推。我的应用程序的根是a UITabViewController,并且选项卡现在部分出现在屏幕下方。最糟糕的是,结束通话后,视图现在占据了整个屏幕空间,但是选项卡栏仍部分位于屏幕下方!更奇怪的是,当启动应用程序并且用户接听电话或离开该应用程序时,在通话处于活动状态时拨打电话并返回到该应用程序时,它会按预期调整大小。(因此,只有在通话进行中从头启动应用程序时才会发生这种情况)

我只能看到的与此相关的帖子是通话状态栏如何影响UIViewController的视图大小?

答案之一是建议更改“自动调整大小”蒙版:

public override func viewDidLoad() {
    super.viewDidLoad()
    self.view.autoresizingMask = .flexibleHeight
}
Run Code Online (Sandbox Code Playgroud)

在我的UITabBarController,但它什么都没有改变。

另一个答案建议设定wantsFullScreenLayoutfalse,这是默认规则UIViewControllers,但不适合UITabBarControllers。但是,此属性在iOS 7中已弃用,建议使用edgesForExtendedLayoutextendedLayoutIncludesOpaqueBars代替。

我在那里找不到足够的信息来了解我应该如何解决此问题。有没有人有一个想法?

注意:对于某些图像,这将是非常说明性的,但是由于这些图像尚未发布,因此我无法发布

ios uistatusbar autoresizingmask

7
推荐指数
1
解决办法
263
查看次数

状态栏背景在iOS 11上隐藏时消失

从iOS 11开始,当我解雇时,我的应用程序中的状态栏是行为不端的.状态栏被取消时,状态栏的背景变为清晰状态.它在iOS 10中没有这样做.

状态栏错误

我在一个非常简单的应用程序中重新创建了这个问题,我已经在Github上发布了:TestStatusBarBug.以下是所有相关代码:

AppDelegate.m

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [[UINavigationBar appearance] setBarTintColor:[UIColor grayColor]];
    return YES;
}

@end
Run Code Online (Sandbox Code Playgroud)

ViewController.m

#import "ViewController.h"

@interface ViewController () {
    BOOL _statusBarHidden;
}

@end

@implementation ViewController

-(BOOL)prefersStatusBarHidden
{
    return _statusBarHidden;
}

-(UIStatusBarAnimation)preferredStatusBarUpdateAnimation
{
    return UIStatusBarAnimationSlide;
}

- (IBAction)toggleStatusBar {
    _statusBarHidden = !_statusBarHidden;

    [UIView animateWithDuration:0.35 animations:^{
        [self setNeedsStatusBarAppearanceUpdate];
    }];
}

@end
Run Code Online (Sandbox Code Playgroud)

还有其他人遇到过这个问题吗?有修复或解决方法吗?

statusbar uinavigationcontroller ios uistatusbar ios11

7
推荐指数
1
解决办法
711
查看次数

自动调整uiview

我有UIView一个UITabController.其中有一个UITableView.

在呼叫状态栏中切换时,它不会执行任何操作,并且视图不会自动调整大小.

它假定正确的大小取决于UIStatusBar应用程序启动时是否切换,但如果UIStatusBar在应用程序运行时切换,则没有任何更改.

带有a的另一个标签视图UINavigationController似乎调整好了.

这是代码

if ([indexPath indexAtPosition:0] == 0 || [indexPath indexAtPosition:0] == 1) {
        if (!airportChooser) {
            airportChooser = [[AirportChooserController alloc] init];
            airportChooser.targetController = self;
            airportChooser.view.autoresizesSubviews = YES;  
            airportChooser.view.autoresizingMask = UIViewAutoresizingFlexibleHeight;
            [airportChooser.view setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleWidth];
        }
        airportChooser.target = [indexPath indexAtPosition:0];
        [self.parentViewController.parentViewController.view addSubview:airportChooser.view];
        self.parentViewController.parentViewController.view.autoresizesSubviews = YES;
        self.parentViewController.parentViewController.view.contentMode = UIViewContentModeRedraw;
        [self.parentViewController.parentViewController.view setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleWidth];
        airportChooser.view.contentMode = UIViewContentModeRedraw;
        //[airportChooser open];
    }

iphone objective-c uitableview autoresize uistatusbar

6
推荐指数
1
解决办法
3万
查看次数

preferredStatusBarUpdateAnimation被忽略

我有AuthViewController这样的表现MainViewController:

let mainVC = MainViewContoller()
mainVC.modalTransitionStyle = .CrossDissolve
authVC.presentViewController(mainVC, animated: true, completion: nil)
Run Code Online (Sandbox Code Playgroud)

我希望AuthViewController隐藏状态栏,但是MainViewController要显示,如下所示:

AuthViewController {

    override func preferredStatusBarStyle() -> UIStatusBarStyle {
        return .LightContent
    }

    override func preferredStatusBarUpdateAnimation() -> UIStatusBarAnimation {
        return .Fade
    }

    override func prefersStatusBarHidden() -> Bool {
        return false
    }
}

MainViewController {

    override func preferredStatusBarStyle() -> UIStatusBarStyle {
        return .LightContent
    }

    override func preferredStatusBarUpdateAnimation() -> UIStatusBarAnimation {
        return .Fade
    }

    override func prefersStatusBarHidden() -> Bool {
        return false …
Run Code Online (Sandbox Code Playgroud)

uiviewcontroller uiviewanimation uistatusbar swift

6
推荐指数
1
解决办法
1666
查看次数