iphone-x

iOS 11 iPhone X simulator UITabBar icons and titles being rendered on top covering eachother

冷暖自知 提交于 2019-11-27 10:26:41
Anyone having issue with the iPhone X simulator around the UITabBar component? Mine seem to be rendering the icons and title on top of each other, I'm not sure if I'm missing anything, I also ran it in the iPhone 8 simulator, and one actual devices where it looks fine just as shown on the story board. iPhone X: iPhone 8 David Hooper I was able to get around the problem by simply calling invalidateIntrinsicContentSize on the UITabBar in viewDidLayoutSubviews. -(void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; [self.tabBar invalidateIntrinsicContentSize]; } Note: The bottom of the tab

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

How to handle iphone screen sizes/resolution for background images

a 夏天 提交于 2019-11-27 05:37:33
After the iPhoneX, I am really struggling with the image sizes and naming conventions which supports all devices. Is there any way to use 3x images for 4.7, 5.5 snd 5.8 screens? What are the exact dimensions I should use for an imageview in full screen? You can use image with .pdf format. So you need to manage only single scale image with 1x. It will support all screen sizes so you don't need to mange 1x,2x,3x png. So single image can adjust all devices and also reduce app size. You can follow these simple steps to implement this method: Step 1: Get your background image with 1x size in .png

How to Add iPhoneX Launch Image

耗尽温柔 提交于 2019-11-27 04:04:12
问题 Using Xcode Version 9.0 (9A235), I am trying to add a Launch Image for iPhoneX at the requested 2436px × 1125px (landscape). Currently I am using a Storyboard and it looks like this: 'launchimage' is an Image View linked to an Image Set: And the Image Set is as follows: The only place I get an iPhoneX sized image is in a Launch Image set: But when I try to select a Launch Image in the Image View on the storyboard it can't be selected: Any help on how to add the correct sized launch image for

iOS 11 iPhone X simulator UITabBar icons and titles being rendered on top covering eachother

南笙酒味 提交于 2019-11-27 04:02:00
问题 Anyone having issue with the iPhone X simulator around the UITabBar component? Mine seem to be rendering the icons and title on top of each other, I'm not sure if I'm missing anything, I also ran it in the iPhone 8 simulator, and one actual devices where it looks fine just as shown on the story board. iPhone X: iPhone 8 回答1: I was able to get around the problem by simply calling invalidateIntrinsicContentSize on the UITabBar in viewDidLayoutSubviews. -(void)viewDidLayoutSubviews { [super

iPhone X / 8 / 8 Plus CSS media queries

旧巷老猫 提交于 2019-11-26 18:50:46
问题 What are the CSS media queries corresponding to Apple's new devices ? I need to set the body 's background-color to change the X's safe area background color. 回答1: iPhone X @media only screen and (device-width : 375px) and (device-height : 812px) and (-webkit-device-pixel-ratio : 3) { } iPhone 8 @media only screen and (device-width : 375px) and (device-height : 667px) and (-webkit-device-pixel-ratio : 2) { } iPhone 8 Plus @media only screen and (device-width : 414px) and (device-height :

iOS 11 Layout guidance about safe Area for iPhone x

旧街凉风 提交于 2019-11-26 18:14:02
问题 My application already in app store, yesterday i have updated my Xcode version to 9 and works fine except iPhone x . UI got collapsed. 1.Here I have Created Two UIView (both are fixed height) named as Header and Tab bar and I have hidden my NavigationBar entire app. 2.Added extension to UIViewController for making Header and Tab bar func addHeaderTab(currentViewController:UIViewController,content:String, isMenu:Bool){ let noView = TopHeaderView() noView.tag = 12345 noView.isMenu = isMenu

Get safe area inset top and bottom heights

橙三吉。 提交于 2019-11-26 17:34:40
问题 On the new iPhone X, what would be the most proper way to get both top and bottom height for the unsafe areas? 回答1: 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?

Can we test Face ID in simulator?

旧城冷巷雨未停 提交于 2019-11-26 16:57:53
问题 Can we test biometric authentication using the simulator? The iPhone X Simulator shows a menu for Face ID enrollment, but after enabling that, what can I do? How it will recognize a face for authentication? 回答1: Simulator does not recognise a face but allows you to simulate a matching and non-matching faces, if you've enabled Enrolled option from Face ID . Add following code to your view controller and try with Face-ID import LocalAuthentication class ViewController: UIViewController {