如何在setStatusBarHidden之后设置顶部位置= 0:是的? [英] How to set the top position = 0 after setStatusBarHidden:Yes?

查看:118
本文介绍了如何在setStatusBarHidden之后设置顶部位置= 0:是的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现在设置

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO]

viewDidLoad ,然后如果我想将图像对齐到顶部,我需要将其位置设置为.y = -20;

at viewDidLoad, then if I want to align an image to the top, I will need to set its position as .y = -20;

无论如何要设置顶部位置的y坐标 0 ?或隐藏状态栏后注定是-20?

Is there anyway to make the y coordinate of the top position to 0 ? or is it doomed to be -20 after hidding the status bar?

感谢阅读。

推荐答案

我有一个类似的问题,这一段代码为我修好了:

I had a similar problem at one point and this bit of code fixed it for me:

[viewController.view setFrame: [viewController.view bounds]];

这篇关于如何在setStatusBarHidden之后设置顶部位置= 0:是的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆