iphone-x

iphoneX not call prefersStatusBarHidden

雨燕双飞 提交于 2019-12-05 10:21:19
info.plist <key>UIViewControllerBasedStatusBarAppearance</key> <true/> UIViewController override var prefersStatusBarHidden: Bool{ return true } when i use 6p ,it's ok but iphoneX ,it's can't call and StatusBar not hidden You need to check if your view controller is included in a container (i.e. UINavigationController ). If that is the case, the full procedure is this: 1) Set the View controller-based status bar appearance value in info.plist file to YES 2) In your child controller add this code: override var prefersStatusBarHidden: Bool{ return true } 3) Add this extension: // gives control

What would be the User Agent string for iPhone 8, iPhone 8 Plus and iPhone X?

霸气de小男生 提交于 2019-12-05 07:53:34
In a device detection, what would be the user agent for the new iPhone 8, iPhone 8 Plus and iPhone X? Here is the user agent string for them: Mozilla/5.0 (iPhone; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.25 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1 Source: The iOS 11 GM firmware model number is 15A372 , which will very likely be the same as the model number of the final iOS 11. Here is a user agent from a beta version of iOS 11, which has the AppleWebKit and Safari version number. As far as I know, user agent for iPhone 8, iPhone 8 plus and iPhone X are same. To detect

prefersHomeIndicatorAutoHidden not working on iPhone X

守給你的承諾、 提交于 2019-12-05 07:09:23
I am currently updating one of my apps to iPhone X and tried to hide the home indicator on a fullscreen viewcontroller showing an image using: override func prefersHomeIndicatorAutoHidden() -> Bool { return true } This method seems to do nothing, though. It is never called and the home indicator is never hidden, even after a while of inactivity. The simulator does seem to support this since the Photos app does hide the home indicator. Is there some other flag that needs to be set to make this work? I tried it in multiple view controllers and none of them show the correct behaviour. I also

iPhone X Safe Area Appears to be below Opaque Toolbar

Deadly 提交于 2019-12-05 05:29:56
I can't properly constrain a view on the iPhone X to be above the bottom opaque toolbar. You can see here that the view constrained to the bottom of the Safe area is obscured by the toolbar: While for other iPhone models and sizes the view is correctly displayed above the toolbar: Here are the constraints I've added: Could someone kindly explain me what should I do? I've solved the issue by selecting "Extend edges under Opaque Bars" for the UIViewController in question: With option enabled: With option disabled: The other option is to use a translucent toolbar as @Silmaril has mentioned in

Emulate iPhone X on Chrome

偶尔善良 提交于 2019-12-05 00:37:00
问题 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

How to add the iPhone X screen dimensions to the mix of different iPhone dimensions in Unity

允我心安 提交于 2019-12-04 22:37:55
Generally for Unity I design all my artwork in Illustrator. So I start off with 1440x1920 (for portrait games) and outline a red frame of 1080x1920. So everything that fits well within the 1080x1920 usually covers the family of iOS devices for me. Then I set the Pixels Per Unit to 192 for all my images. This approach has really served me well. Now that the iPhone X is in the mix, how can I cater for it in a similar way? As My experience, you don't have to do many things, the gameobject in a scene will just fit well, Unity has done that for you the only thing you maybe need to do is adjust the

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

南楼画角 提交于 2019-12-04 17:49: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

UITableview merging with the home indicator on iPhone X

☆樱花仙子☆ 提交于 2019-12-04 14:53:25
I have a UITableView created programmatically. This UITableView merges with the home indicator on an iPhone X device. How can I fix this issue? Programatically, set bottom anchor of tableview with bottom anchor of SafeAreaLayout. Here is sample/test code, how to programatically set safe area layout with respect to interface elements. if #available(iOS 11, *) { let guide = view.safeAreaLayoutGuide NSLayoutConstraint.activate([ table.topAnchor.constraintEqualToSystemSpacingBelow(guide.topAnchor, multiplier: 1.0), guide.bottomAnchor.constraintEqualToSystemSpacingBelow(table.bottomAnchor,

Can I get the measurements for eyes using ARKit 2

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 08:44:38
问题 I am working on a project which requires size of each eye and distance between the eyes using ARKit and True depth Camera on iPhone X with iOS 12 beta 4 on Xcode 10 beta 4. As I am new to ARKit, I am searching the solution online with very little understanding. However, I came across a demo code on apple developer portal. In that code, I tried to fetch the required values. Also referred to the answer by @rickster I worked on ARSCNFaceGeometry and ARFaceAnchor to fetch few values. func update

applicationDidBecomeActive firing on deactivation on iPhone X

北城以北 提交于 2019-12-04 04:37:22
问题 Is anyone else having trouble with applicationDidBecomeActive incorrectly firing on deactivation of the app on the new iPhone X? Here's my test app: class ViewController: UIViewController { required init?(coder aDecoder: NSCoder) { super.init(coder:aDecoder) NotificationCenter.default.addObserver( self, selector: #selector(fired), name: .UIApplicationDidBecomeActive, object: nil ) } @objc func fired(_:Any) { print("fired") } } Run the app on the iPhone X simulator. Naturally, I see "fired" in