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
2 answers

Am having trouble moving code into a separate function

From within my GameViewController's viewDidLoad() function I do two things: 1- I create a sub UIVIew, myView, which is added to the main view, 2- I call my function, addConstraints, which is in the GameViewController's code. When I create GameScene,…
LuisC329
  • 131
  • 8
0
votes
1 answer

I can get GameScene:SKScene to appear using the layout constraints, but why can I still draw inside the safe ares?

Below is the code from GameViewController I use to present my GameScene. GameScene comes out respecting the safe areas (iPhone X). However if I create an SKSprite node, the coords for the upper screen draw into the safe area. My impression was that…
Caractacus
  • 83
  • 7
0
votes
1 answer

Why does getting my view's frame return the full screen, even tho the view has been run through the safeArea constraints?

Before presenting my GameScene I apply the safeAreaLayoutGuide to the initial view screen (code below is from GameViewController). If at any point before I call view.presentScene(scene) I try to get the view's frame, I get back an empty set. If…
Caractacus
  • 83
  • 7
0
votes
1 answer

How can I avoid covering the safe area on iPhones, but at least change their color?

I've noticed that some iPhone apps cannot not only stay away from the safe areas on the iPhone, but they also change the background color of the safe areas, whilst not covering the upper status bar info, icons, time, etc. I can make my background…
Caractacus
  • 83
  • 7
0
votes
2 answers

safeAreaLayoutGuide not updated after rotating the device

I present a UIViewController out, which uses autolayout to set the constraints for the sub views inside the view of the view controller. all the constraints are kept in the code, without storyboard or xib. I add the safeAreaLayoutGuide inside the…
0
votes
1 answer

UINavigationBar or statusBarHeight -> 0 when CGAffineTransform applied to viewController.view

I am writing an interactive transition via UIViewControllerAnimatedTransitioning. As part of the transition, I apply a CGAffineTransform to the from view controller. As soon as the transform is applied, fromViewController loses its safeAreaInset at…
0
votes
1 answer

topLayoutGuide.length depreciated

I am still a beginner with xCode and would be happy if someone could help me. This is my code: if(magnetLinkTextField.frame.origin.y<=0) { UIView.animate(withDuration: 0.2, animations: { self.magnetLinkTextField.frame =…
user13466745
0
votes
0 answers

How to prevent Safe Area from resizing according to image view?

In Interface Builder I have a simple view that contains a UIImageView and am trying to constrain the image view's width and height. I have added constraints several ways but whenever I run in the Simulator the image view does not display correctly…
Alyoshak
  • 2,696
  • 10
  • 43
  • 70
0
votes
1 answer

Partial safe area on Xamarin.Forms

I have a page with a ListView that needs safe area padding so that the iPhone X bump doesn't clip the ListView content in landscape orientation. However, the bottom of the ListView doesn't need padding; the rounded bottom corners of the screen don't…
Edward Brey
  • 40,302
  • 20
  • 199
  • 253
0
votes
1 answer

How to remove the safe area margin in xamarin ios

I want to remove safe area margin for all my view controller views. I have tried the below code but it is not working. I dont know how to remove the safe area margin. public override UIEdgeInsets AdditionalSafeAreaInsets { get =>…
DotNetUser
  • 415
  • 3
  • 18
0
votes
2 answers

How do I set the safe zone size by device?

I want to set a safety zone by device. My web view is set to SafeArea above, SuperView below. After the iPhone X series, the value of Y is 44 because of the notch area. But for the iPhone 6 and iPhone 8, 44 is too wide. How do I adjust it? Area of…
iosbegindevel
  • 307
  • 5
  • 20
0
votes
3 answers

How to get safe area in android for notch devices

I need to handle layout for notch devices. I know in Ios. I can handle it using safe area in Ios. But in android is there any way to achieve this ?
Amit Desale
  • 1,281
  • 3
  • 16
  • 43
0
votes
0 answers

Buttons inside iOS top safe area?

I can't find any info about it at all. In my case: no status bar portrait mode only 2 buttons in the top device corners Can these buttons overlap the top safe area on iPhone X-like devices?
Vyachaslav Gerchicov
  • 2,317
  • 3
  • 23
  • 49
0
votes
1 answer

Safe area constrained views get magnified with status bar toggled hidden/unhidden when navigating between UIViewControllers in iOS

Like the title says, there is an unexpected behavior that safe area constrained views get magnified on iOS when you try to navigate between UIViewControllers while toggling status bar hidden/unhidden. A reproducible project can be found here. I…
inexcii
  • 1,591
  • 2
  • 15
  • 28
0
votes
0 answers

UIView goes under top status bar, it came back to right position when scrolling collection view

I am facing an issue with UIView which goes under top bar. But it placed at right position when I scroll collection view which is below white view showing in Image. After scroll collection view : can anyone have idea why this happened? Thanks.
Manish
  • 608
  • 1
  • 11
  • 23