Re: overlapping status bar
Re: overlapping status bar
- Subject: Re: overlapping status bar
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Sat, 30 Nov 2013 13:20:04 +0700
On 30 Nov 2013, at 00:42, Kyle Sluder <email@hidden> wrote:
>> On Nov 29, 2013, at 1:18 AM, "Gerriet M. Denkmann" <email@hidden> wrote:
>>
>> The problem: the status bar is visible (as it should be) but it overlaps both view a and b, which looks ugly.
>> Is there any way to tell these views to move down a little bit (using autolayout)?
>
> UIViewController.topLayoutGuide.
in viewDidLoad of my ViewController I added:
id <UILayoutSupport> topGuide = self.topLayoutGuide;
NSLog(@"%s topGuide: %@, length: %g, preferHidden: %d",__FUNCTION__,
topGuide, topGuide.length, self.prefersStatusBarHidden);
which prints:
topGuide: <_UILayoutGuide: 0x10f433230; frame = (0 0; 0 0); hidden = YES; layer = <CALayer: 0x10f44a4d0>>, length: 0, preferHidden: 0
"hidden = YES" seems strange as I can clearly see the statusBar (the thing with Carrier, Clock and Battery on top). "length = 0" rimes with "hidden = YES" but not with reality.
Not surprisingly, adding:
NSLayoutConstraint *newOne = [ NSLayoutConstraint constraintWithItem: topGuide
attribute: NSLayoutAttributeBottom
relatedBy: NSLayoutRelationEqual
toItem: self.view
attribute: NSLayoutAttributeTop
multiplier: 1
constant: 0
];
[ self.view addConstraint: newOne ];
has no effect at all.
By the way: my ViewController is part of a UISplitViewController. The same view works very nicely when part of a UINavigationController.
iOS 7.0.4
Kind regards,
Gerriet.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden