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
0
votes
0 answers

ConstraintsWithVisualFormat for iPhone X safe area

This line of code to be converted to safe area for iPhone X self.view.translatesAutoresizingMaskIntoConstraints = NO; id views = @{ @"carbonTabSwipe" : self.view, @"topLayoutGuide" : rootViewController.topLayoutGuide, …
niravdesai21
  • 4,818
  • 3
  • 22
  • 33
0
votes
1 answer

How to add safe area layout to UIStackView programmatically?

I was wondering if there is a smart way to add safe area layout to a UIStackView programmatically. Currently this is my setup: // AppDelegate.didFinishLaunchingWithActions let rvc = window?.rootViewController adViewController =…
Hugo B.
  • 471
  • 1
  • 8
  • 23
0
votes
0 answers

Used ' Use Safe Area Layout Guides' with image in center of view. view is shifted to left

[Attached screenshot, Blue is View of ViewController.]I want to support for iPhoneX & IOS from 10 - 11+. I select ' Use Safe Area Layout Guides' option. Added image view in center & set layout constraint with Safe area. & run on simulator/ device…
0
votes
0 answers

Is it dangerous to size the height of a custom iOS navigation bar by detecting the device?

I have an app with a custom iOS navigation bar as in, I'm building it from scratch by subclassing UIView. I want the navigation to extend from the top safe area or below the top status bar (depending on which iOS version & device we're talking…
Tony
  • 18,776
  • 31
  • 129
  • 193
0
votes
1 answer

iOS safeAreaLayoutGuide gives full 812 height for iPhone X

This is also described but not answered in Why does this iPhone X UIView not get safeAreaLayoutGuide? I create a totally-new from-scratch single-view Universal iOS app and add only these three lines of code to viewDidLoad(). I launch the iPhone X…
Andrew Duncan
  • 3,553
  • 4
  • 28
  • 55
0
votes
1 answer

in Snapkit, safeAreaLayoutGuide on tableViewController isn't work

I want to put BlueView under NavigationBar on TableViewController. But it does not work. like [1]: https://i.stack.imgur.com/40Crj.jpg class TableViewController: UITableViewController { private func setupView() { …
QueenaHuang
  • 11
  • 1
  • 2
0
votes
2 answers

How to slide view out of visible area for iPhone X?

I want a view to slide up, outside the visible area, when the navigation bar hides. The view is attached to the safeAreaLayoutGuide: topConstraint = myView.topAnchor.constraint(equalTo: view.layoutMarginsGuide.topAnchor) To slide it out, the…
Manuel
  • 14,274
  • 6
  • 57
  • 130
0
votes
0 answers

iOS - View above all other views with Safe Area

I would like to put a UIView above all other views. I saw that this is possible using the UIScreen object. However, it looks like the UIScreen doesn't have a Safe Area. This let's the View overlap with the Statusbar. How can I place a View above…
evenwerk
  • 947
  • 1
  • 12
  • 28
0
votes
1 answer

NSLayoutConstraint and safeAreaLayoutGuide - coding compatible for pre-iOS 11

If I want an app compatible for pre-iOS 11 devices, do I need this code for each and every constraint that links some property of a view to self.view in order to abide by safeAreaLayoutGuide? if #available(iOS 11.0, *) { …
RanLearns
  • 4,086
  • 5
  • 44
  • 81
0
votes
1 answer

UITableViewController top bar on iPhone x

I found problem with one of my app's screens UITableViewController on iPhone X. I am talking about color of top bar. Other screens in app are presented as UIViewControllers where I have no problem with safe area setting background to be till the…
moonvader
  • 19,761
  • 18
  • 67
  • 116
0
votes
2 answers

programmatically adjust collectionView for safeArea

I'm trying to set up a horizontally scrolling collection view that has cells with size CGSize(width: view.frame.width, height: view.frame.height). However, my cells are partially covered at the top by the navigation bar and using edge insets doesn't…
0
votes
0 answers

Sprite Kit iOS 11 | Place nodes only in safe area

I want to program a simple Sprite Kit game in which I have to place some nodes randomly somewhere in the scene. To ensure that these nodes are not placed outside the safe area I programmed this function: func updatesafearea() { let frame =…
Jonas
  • 1
  • 1
0
votes
0 answers

iPhoneX fullscreen without using storyboard (Using Objective C GLKViewController)

I have an OpenGL Objective C App (based on a custom GLKViewController) without using storryboards (using xib files) and want to use the full resolution on the iPhoneX. How can I achieve this? I tried overloading viewWillLayoutSubviews and changing…
Bastl
  • 883
  • 2
  • 10
  • 27
0
votes
2 answers

top bar overlapping in unsafe area

my top bar works fine in all other iPhones except iPhoneX due to safe area introduction.The top bar starts in unsafe area itself.The top bar is a custom UI.It looks as below: The code is as follows: //Top Bar let topBar =…
0
votes
1 answer

Extend touch area on iPhone X in landscape mode

If a UIViewController is launched in landscape mode, even though the home indicator is not on the right side, still the rightmost 44 points on the screen do not respond to touches. I am wondering what is the purpose of disabling those pixels for…
Deepak Sharma
  • 5,577
  • 7
  • 55
  • 131
1 2 3
15
16