Questions tagged [safearealayoutguide]

The safeAreaLayoutGuide is a property from UIView class (Apple iOS) representing the portion of the view that is unobscured by bars and other content.

Apple documentation for safeAreaLayoutGuide.

240 questions
2
votes
1 answer

Reset Constraints for the other components after removing a UIView

I got a banner UIView which I want to remove if the user has NoAds Feature. Problem is after I remove the banner UIView, I cant' find a way to set the constraints of the top view to wrap the rest of ViewController. Here are some images for you to…
2
votes
1 answer

Adding margins to a scene that uses the Safe Area

Is it possible to constrain to the Safe Area AND use margins? I'm following Build a Basic UI here. In the "Adopt Auto Layout" section, I'm supposed to add constraints to my stack view: Even though I have "Constrain to margins" checked, here is what…
Mike Miller
  • 3,368
  • 5
  • 36
  • 49
2
votes
2 answers

How to specify offset from safe area in iOS below 11?

In iOS 11 I use safeAreaInsets to specify the offset from safe area to my custom view like this: var frame: CGRect if #available(iOS 11.0, *) { frame = CGRect(x:0, y: self.view.safeAreaInsets.top + 16, …
Andrey M.
  • 3,021
  • 29
  • 42
2
votes
3 answers

Position element to CGRect with Safe Area

I´m declaring a button: let button = UIButton(frame: CGRect(x: ?, y: ?, width: 50, height: 50)) But I´m note sure how to set x and y relative to the Safe Area so that it works good on both >= iOS 11 and <= iOS 10. I tried to use…
user9400347
  • 43
  • 1
  • 3
2
votes
1 answer

Using maximal screen with in landscape on iPhone X

I'm currently setting up the layout constraints of a web view like this: UIView *theView = self.view; UILayoutGuide *theGuide = theView.safeAreaLayoutGuide; inWebView.translatesAutoresizingMaskIntoConstraints = NO; [theView.topAnchor…
clemens
  • 16,716
  • 11
  • 50
  • 65
2
votes
2 answers

How to fix - safeAreaLayoutGuide' is only available on iOS 11.0 or newer

In my app I have this error - safeAreaLayoutGuide' is only available on iOS 11.0 or newer In this code the error appears 3 times. Basically in each of the rows where I use safeArea. NSLayoutConstraint.activate([ …
Viktor
  • 75
  • 4
  • 13
2
votes
1 answer

Need help regarding safe area layout

I added constraints properly with respect to super view instead of a safe area but still I am facing an issue of grey area on top and bottom of specific screen.it should appear completely on the whole screen at I Phone X. Please follow the…
2
votes
0 answers

iPhone X Safe Area: turned off but view is still aligning to them

I've turned off both safe area relative margins and safe area layout guide but I am still getting this blacked out area at the top of the screen. Interesting thing is it is also showing up, in the sim, on a iPhone 7 running 10.3. Am I missing…
PruitIgoe
  • 6,166
  • 16
  • 70
  • 137
2
votes
1 answer

iPhone X safe area not working

Currently I’m working in this project where I need to resolve a UI issue for iPhone X. I did some reading that said developers can use safe areas in XIB and it will resolve the problem. So I did it, and the simulator looks fine, but not my real…
Wong Wengkeong
  • 181
  • 1
  • 14
2
votes
3 answers

Why isn't storyboard safe area working correctly on iPhone X?

I'm trying to update my app for the new iPhone X. After reading about the safe area feature and the check box "Safe Area Relative Margins" in each UIObject's "Size Inspector" (ruler tab), I didn't think this would be too bad. However, that feature…
Prime624
  • 226
  • 4
  • 14
2
votes
2 answers

iOS 11 MapView Compass under NavigationBar and SafeArea not working on iOS 10

I'm struggling with migrating my App to iOS 11. For reusability I split my hierarchy into multiple StoryBoards. In the first StoryBoard I have a custom container view controller which hosts a tab bar and a special view (MonitoringView). It is…
xxtesaxx
  • 6,175
  • 2
  • 31
  • 50
2
votes
0 answers

Xamarin.Forms: iPhone X SafeArea with Forms ListView

How do you guys handle the safe area problem for ListViews with Xamarin.Forms? Just setting the safe area as margin on the whole ListView looks ugly AF. So I search for something like a custom renderer to make the ListView as equal als possible to…
Sebastian
  • 259
  • 3
  • 18
2
votes
0 answers

How/when does iOS determine safeAreaLayoutguides and layoutMargins?

While working on a custom UINavigationController transition, I noticed something interesting: I create a copy of a UIView in my fromController, and add it to the transitionContext to do an animation, but it has a different value for…
GoldenJoe
  • 7,874
  • 7
  • 53
  • 92
2
votes
1 answer

iPhone X interface programming without autolayout

I have an old app source code that uses storyboard & xib without auto layout or size classes. Even though I am rewriting it from scratch, it would take some time as number of modules are too many. The immediate need is to fix the code that manually…
Deepak Sharma
  • 5,577
  • 7
  • 55
  • 131
2
votes
1 answer

iOS - How to create view inside Safe Area programmatically

I have started using Safe Area after iPhone X with AutoLayout. Now I want to draw a view from bottom of screen to all other screens and for iPhone X from bottom of safe area. I have been using self.view.frame.size.height but it creates below safe…
Hassy
  • 5,068
  • 5
  • 38
  • 63