0

xcode tool preview

iphone screenshot

I have used to set something on statusbar position and I removed it. But now, I want to set the statusbar into clearcolor. And there was a view appeared. I checked the code already, there is nothing about the statusbar in my code. How to remove this view?

  - [2] : <UIView: 0x1014ecaf0; frame = (0 0; 414 20); tag = 100; layer = <CALayer: 0x17442ddc0>>

I printed the view's subviews, I don't know who create this view. And this view make the problem.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Lara Wang
  • 1
  • 2
  • I can't able to identify ur issue... can u elaborate ur question and ur image is not clear to understand the issues – NAVEEN KUMAR Apr 27 '17 at 04:19
  • UIStatusBarHidden UIViewControllerBasedStatusBarAppearance . u checked these properties – NAVEEN KUMAR Apr 27 '17 at 04:20
  • I checked your keys in my project.I didn't set UIStatusBarHidden in my project.And "UIViewControllerBasedStatusBarAppearance" in my plist was NO already. – Lara Wang Apr 27 '17 at 04:39
  • ok .... u want to set ur status bar colour custom colour..? ...now ...? – NAVEEN KUMAR Apr 27 '17 at 04:47
  • And i don't know who creat a view on the status bar position.It cover the background color. I swear i did't creat a view in this controller. – Lara Wang Apr 27 '17 at 04:51
  • is this presentviewcontroller ? – KKRocks Apr 27 '17 at 04:54
  • add this line : if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) self.edgesForExtendedLayout = UIRectEdgeNone; – KKRocks Apr 27 '17 at 04:59
  • Did I understand right, that you are trying to paint your status bar the same color as the view under it? – The Dreams Wind Apr 27 '17 at 05:05
  • statusbar should be clearcolor in default setting.i don't know why there auto-create a view under the status bar. And this small view cover the view background color. – Lara Wang Apr 27 '17 at 05:26

2 Answers2

0

It's likely that your top view in Interface Builder is arranged to the Top Layout Guide. If you want it to be somewhat overlapped by the Status Bar, so the Status Bar lie on it and use its color as backroung, you need set your top constaint to be arranged with the superview, not the the Top Layout Guide.

Please check this answer for more details.

Community
  • 1
  • 1
The Dreams Wind
  • 8,416
  • 2
  • 19
  • 49
0

I think i find the wrong in my code.I'm so sorry.I used my teammate's tool class,he create a view cover the status bar to solve his problem.In some special condition that view didn't exist.So i find it for a long time.Sorry about that.

But i still learn a lot.Thank all you guys.

Lara Wang
  • 1
  • 2