safearealayoutguide

How to extend bottom view colour below the home indicator in iPhone X?

做~自己de王妃 提交于 2019-11-30 11:31:09
问题 Please check the attached image. The Viewcontroller's view's background colour is blue. This colour extends below the status bar and below the home indicator as you can see. There is a white view at the bottom which is a button. Here the white view is inside the safe layout guide. I want the same white colour to extend below the home indicator without adding any additional view only for iPhone-X. How to do this? 回答1: You need to set/attach bottom constraint of you white view with super view.

Swift Safe Area Layout Guide and Visual Format Language

我是研究僧i 提交于 2019-11-30 11:03:22
I want to use Apples visual format language to constrain a view to the new Safe Area Layout Guide in iOS 11. However, I get an exception: -[NSLayoutYAxisAnchor nsli_superitem]: unrecognized selector sent to instance 0x1c447ed40 //Make View Dictionary var views: [String: Any] = ["left": self.leftContainer] //Check swift version and add appropriate piece to the view dictionary if #available(iOS 11, *) { views["topGuide"] = self.view.safeAreaLayoutGuide.topAnchor }else{ views["topGuide"] = self.topLayoutGuide } //Make the constraint using visual format language let leftVertical =

Objective C : How to create self.view inside Safe Area programmatically

故事扮演 提交于 2019-11-30 01:25:31
I have just changed my app from supporting iOS 8 and up to supporting iOS 9 and up. Since I don't use storyboards to create my views, I was wondering if there's the "Use Safe Area Guides" option programmatically or something like that. I've tried to anchor my view but they keep overlapping the top & bottom in the iPhone X simulator. Try this in Objective-C and see: UIView * myView = // initialize view using IBOutlet or programtically myView.backgroundColor = [UIColor redColor]; myView.translatesAutoresizingMaskIntoConstraints = NO; if (@available(iOS 11, *)) { UILayoutGuide * guide = self.view

How to extend bottom view colour below the home indicator in iPhone X?

情到浓时终转凉″ 提交于 2019-11-30 00:24:07
Please check the attached image. The Viewcontroller's view's background colour is blue. This colour extends below the status bar and below the home indicator as you can see. There is a white view at the bottom which is a button. Here the white view is inside the safe layout guide. I want the same white colour to extend below the home indicator without adding any additional view only for iPhone-X. How to do this? You need to set/attach bottom constraint of you white view with super view. Follow these steps and see: Check bottom/bottom alignment constraint of your view. It may be attached with

Swift Safe Area Layout Guide and Visual Format Language

一世执手 提交于 2019-11-29 16:27:53
问题 I want to use Apples visual format language to constrain a view to the new Safe Area Layout Guide in iOS 11. However, I get an exception: -[NSLayoutYAxisAnchor nsli_superitem]: unrecognized selector sent to instance 0x1c447ed40 //Make View Dictionary var views: [String: Any] = ["left": self.leftContainer] //Check swift version and add appropriate piece to the view dictionary if #available(iOS 11, *) { views["topGuide"] = self.view.safeAreaLayoutGuide.topAnchor }else{ views["topGuide"] = self

How to set unsafe area background color for ios 11

我怕爱的太早我们不能终老 提交于 2019-11-28 21:30:21
Creating some new view controllers with xcode 9 so now I have a few safe areas to deal with. I am currently trying to do something fullproof, meaning keeping the unsafe area as it is (since I always display the status bar) and having the background color extending to the fullscreen (to keep a similar behaviour to what I used to have). On an additional note, this also affect page controls since when you have some the system will put them in the bottom unsafe area which will also be displayed in black. I cannot find a way for the background color to extend behind the unsafe area though. Any

ios13 UIPopoverViewController showing UITableViewController - Safe Area problems / Missing parts of table

。_饼干妹妹 提交于 2019-11-28 04:53:39
问题 In the same theme as this post: iOS 13 - UIPopoverPresentationController sourceview content visible in the arrow I have a UITableViewController instantiated from the Storyboard. I'm presenting it in a UIPopoverViewController. Depending on orientation I either have a side missing or the top missing and the content of the _UITableViewHeaderFooterViewBackground scrolls 'through' the arrow. What's wrong: These are when it's on the top, but if it presents on the side then the whole side EDIT: I AM

Objective C : How to create self.view inside Safe Area programmatically

半世苍凉 提交于 2019-11-27 11:59:04
问题 I have just changed my app from supporting iOS 8 and up to supporting iOS 9 and up. Since I don't use storyboards to create my views, I was wondering if there's the "Use Safe Area Guides" option programmatically or something like that. I've tried to anchor my view but they keep overlapping the top & bottom in the iPhone X simulator. 回答1: Try this in Objective-C and see: UIView * myView = // initialize view using IBOutlet or programtically myView.backgroundColor = [UIColor redColor]; myView

Get safe area inset top and bottom heights

时间秒杀一切 提交于 2019-11-27 06:12:04
On the new iPhone X, what would be the most proper way to get both top and bottom height for the unsafe areas? user6788419 Try this : In Objective C if (@available(iOS 11.0, *)) { UIWindow *window = UIApplication.sharedApplication.keyWindow; CGFloat topPadding = window.safeAreaInsets.top; CGFloat bottomPadding = window.safeAreaInsets.bottom; } In Swift if #available(iOS 11.0, *) { let window = UIApplication.shared.keyWindow let topPadding = window?.safeAreaInsets.top let bottomPadding = window?.safeAreaInsets.bottom } To get the height between the layout guides you just do let guide = view

iOS 11 safe area layout guide backwards compatibility

自作多情 提交于 2019-11-27 06:08:34
Is enabling Safe Area Layout Guides compatible to iOS below 11? I managed to work with the new Safe Area layout guides and maintain backwards compatibility with iOS 9 and iOS 10: (EDIT: as pointed out in the comments by @NickEntin, this implementation will presume there is a status bar present, which won't be true in landscape on the iPhone X. Resulting in to much space to the top (20 points). It will run perfectly fine however. E.g. if you want a view to be 10 points below the status bar (and 10 points below the sensor housing on iPhone X): In your XIB, go to File Inspector and enable the