iphone-x

iPhone X status bar height

若如初见. 提交于 2019-12-04 02:54:01
I have developed an app without autoLayout or interface-builder , all by code. It runs ok in all iPhones except iPhone X where the top bar stays under the new black thing in the middle. It's possible to get that height by code, so I can shift my Navigationbar that height down and all runs normal ? The solutions I see, they use auto layout. I just want the get the distance to shift it down.. Michael Hulet In my Swift app, I get the frame of the status bar with Swift: UIApplication.shared.statusBarFrame Objective-C: [UIApplication sharedApplication].statusBarFrame That's a CGRect , so you can

Is it possible to access the infrared camera on iPhone X?

笑着哭i 提交于 2019-12-03 20:42:02
According to this picture: the iPhone X has an infrared camera. It is primarily used for face detection but there are other uses for infrared. Can it be accessed directly? not via the approved iOS API library calls. But undocumented API should be possible if you guess how to do it. Still not sure about infrared but to read the depth information from the iPhone X TrueDepth camera, we can use the AVDepthData class and related APIs. Here's a tutorial . The company, reallusion.com makes a 3D animation product called 'iclone 7' which interfaces with the iPhone infrared camera. Try contacting them

Emulate iPhone X on Chrome

╄→гoц情女王★ 提交于 2019-12-03 16:05:56
I need to emulate an iPhone X on Chrome. I have found the info below: Height: 5.65 inches (143.6 mm) Width: 2.79 inches (70.9 mm) Can you tell me which values should I give to the form below? iPhone X sepecifications This is what Device pixel ratio (DPR) is If you want to emulate a Retina device from a non-Retina machine or vice versa, adjust the Device pixel ratio. The device pixel ratio (DPR) is the ratio between logical pixels and physical pixels. Devices with Retina displays, such as the Nexus 6P, have higher pixel density than standard devices, which can affect the sharpness and size of

Launch Image names of iPhoneX?

孤街浪徒 提交于 2019-12-03 14:50:37
问题 A question about iPhoneX. I want put Launch Image of iPhoneX( 1125px × 2436px) in common folder. Not in LaunchImage source. What's the Launch Image names of iPhoneX? just like 'Default-iOS8-736h@3x', I can not found the name in https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/launch-screen/ . 回答1: You can add static launch image for iPhone X, only add: Default-375w-812h@3x.png 回答2: Following the convention it should be named Default-812h@3x.png (and Default

Actually duplicate / extract Apple's “continuous corners for iPhoneX”?

半世苍凉 提交于 2019-12-03 11:31:31
The unusual bottom corners of an iPhoneX are Apple's new (2017) "continuous corners for iPhoneX" . It is trivial for any experienced iOS programmer to approximate the curve, but: Does anyone know exactly how to achieve these, exactly as Apple does? Even if it's a private call, it would be good to know. It does seem bizarre that Apple have not explained this. Please note that it's trivial to "approximate" the curve: To repeat, it is trivial for any experienced iOS programmer to approximate the curve. The question being asked here is specifically how to do Apple actually do it? Please do not

iPhone X keyboard appear showing extra space

隐身守侯 提交于 2019-12-03 11:06:53
问题 I have created a chat UI in which I have added a constraint for the tableView to the bottom of the screen. I am changing the constraint value by adding the height of the keyboard which is working fine in all the devices except iPhone X. UI when key board is not visible: Which is fine. Problem is when keyboard appears blank space is visible in between the textView and the keyboard: Do I have to try for a different approach for this or it can be resolved using constraints ? 回答1: Try subtracting

How to programmatically detect iPhone XS or iPhone X? [duplicate]

一世执手 提交于 2019-12-03 10:14:37
问题 This question already has answers here : Detect if the device is iPhone X (35 answers) Closed last year . One of my apps connects to a web app service that delivers device specific news to to the user. To adapt this to the latest iPhone versions I need to programmatically distinguish between the iPhone XS and iPhone X. How can this be done? [[UIScreen mainScreen] bounds].size was always a good starting point to tell the different devices apart. However, iPhone XS and iPhone X have the same

iPhone X hide home indicator on view controller

纵饮孤独 提交于 2019-12-03 04:12:25
问题 I have a view controller that takes up the whole screen from top to bottom. I would like to hide the home bar indicator on the bottom of the screen on iPhone X devices. How can I do this in iOS 11? 回答1: You should override prefersHomeIndicatorAutoHidden in your view controller to achieve that: override var prefersHomeIndicatorAutoHidden: Bool { return true } 回答2: There is another alternative. If you are looking for the behavior where the indicator dims, then when the user swipes up it

UICollectionView in landscape on iPhone X

纵然是瞬间 提交于 2019-12-03 04:12:11
问题 When iPhone X is used landscape, you're supposed to check safeAreaInsets to make suitably large gutters on the left and right. UITableView has the new insetsContentViewsToSafeArea property (default true) to automatically keep cell contents in the safe area. I'm surprised that UICollectionView seems to not have anything similar. I'd expect that for a vertically-scrolling collection view, the left and right sides would be inset to the safe area when in landscape (and conversely, a horizontally

Extra bottom space/padding on iPhone X?

你。 提交于 2019-12-03 03:01:26
问题 On the iPhone X in portrait mode, if you set a bottom constraint to safe area to 0, you will end up with an extra space at the bottom of the screen. How do you get programmatically the height of this extra padding ? I managed to manually determine the height of this padding which is 34 and here is how I managed to implement it with iPhone X detection: Swift 4.0 and Xcode 9.0 if UIDevice().userInterfaceIdiom == .phone { switch UIScreen.main.nativeBounds.height { case 2436: //iPhone X self