how to cover ios' baterry&time bar under my AIR app - ios

I use flash builder to develop a game bases on AIR, but here are the question: my app's top position covered by ios' battery&time bar, so I cant click those buttons on the top position. How to resolve this question by using AS3.0 or some other methods?

You can hide the Device's notification bar at compile time by setting <fullScreen>true</fullScreen> in your myApp-app.xml descriptor file, you cannot control this at run time though.

Related

Cordova iOS iPhone X - Home indicator - Edge protection - DeferringSystemGestures?

I'm working on a webapp built with Cordova for both iOS and Android. Everything was fine until I launched tests on the new Apple's iPhoneX. As you may know, Apple decided to remove the physical home button by replacing it by a home indicator at the bottom of the screen:
This home indicator is always visible on your screen and it goes over your webapp content. When user want to navigate between apps or to go back to the home screen, he has to swip up this home indicator (which is very sensitive). This wonderful invention brought to my webapp 2 main problems:
This break my webapp design because it goes over the content.
The system gesture enter in conflict with my webapp gesture. My entire gameplay is based on drag & drop and all draggable icon are at the bottom of the screen, under the home indicator.
1. How to hide the home indicator?
To solve the first point I found a plugin called cordova-plugin-hide-home-indicator. This will hide (with fadeIn/Out effect) the home indicator after a few second of inactivity. But every times a touchscreen event is detected, the home button is visible again... I have red here that even if the Objective C (Xcode) function prefersHomeIndicatorAutoHidden() (which I guess is used by this Cordova plugin) return true it doesn't mean that the home indicator will be hidden for ever. Well... if somebody has a better solution I would appreciate your help!
2. How to lock system gesture?
I found a Xcode function called preferredScreenEdgesDeferringSystemGestures() They explain that normally the system will always take precedence on an app gesture, but in some cases (for immersive games for exemple) you can ask for your app to take precedence on the system. This sounds great! But unfortunately I don't know anything of Objective C :) I didn't find any plugin about that point.
In this video from Apple at 10:33, they talk about edge protection, which should do the trick by giving the app gesture the precedence, but again, I didn't find any plugin for Cordova...
Any ideas? Thanks!
Don't hide the home indicator. The solution by Apple is to use the new CSS constants as padding for the safe areas of the device. Read this to get starting point: iPhone X support
You can use this plugin in order to avoid edge gestures at iOS
https://github.com/distinctdan/cordova-plugin-screen-edges
It's very easy to use, i used in a cordova project and it works as expected

Swift: how to switch statusbar orientation in IOS 9+?

I'm building a game that is based on gestures. IOS' native gestures that bring in notification center and control center on side swipe are super annoying as they interfere with gameplay.
Having searched extensively for a solution, I have come to belive that there is no way to disable/block control center or notification center on app level.
One possible solution that could help that I found was to turn the status bar orientation. My app runs in landscape orientation. If I could switch notification/control centers from top and bottom swipe to left and right swipes, I think that could almoast solve my problem.
However this seems to be possible but depreceted since IOS 9: https://developer.apple.com/documentation/uikit/uiapplication/1622939-setstatusbarorientation?language=objc
Apple suggests to use UITraitCollection instead. However I can't figure out how to change the orientation of the status bar using this. Sample code would be greatly appreciated!
From the same documentation it states:
you should not arbitrarily set status-bar orientation using this
method
This is even more true now because if you do try to use this method you get this warning (and it didn't actually work):
'setStatusBarOrientation(_:animated:)' was deprecated in iOS 9.0:
Explicit setting of the status bar orientation is more limited in iOS
6.0 and later
This is not something you should be trying to do with your app. Either hide the status bar or leave it at the top.

How To Avoid iOS Blue Location NavigationBar Messing Up My StatusBar?

iOS has a feature that (I'm using both iOS 10 and 11) when you use a location-based app, say Waze, and you put that app on the background, there will be a blue navigation bar with a blue status bar background saying that Waze is currently using your location. Then open up your own project and close the Waze, this will happen.
Any idea how to fix this one? I'm guessing some configuration in the AppDelegate. Something to setup upon making your project active. I've tried the same steps in my other project and I have no idea why does that other project handle it a little better. The other project has a readable status bar but different background color, still quite a mess but better than in this project in the photo.
This is how your app should work:
The status bar is transparent.
Your view controller's main view should underlap the status bar; it should be fullscreen.
Your views should use autolayout to respond to changes in the size of the top bars (they should be pinned to the top layout guide or, in iOS 11, the top of the safe area).
You are not doing that correctly, so your app does not behave correctly when the status bar size changes due to the location manager bar. You probably have the same problem with phone calls coming in. You can easily test in the Simulator by choosing Toggle In-Call Status Bar.

How do I make iOS 7 Control Center behave like it does in Maps (small tab)?

In Maps in iOS 7, if you swipe up from the bottom of the screen as if opening control center while the map view is full screen, you get a small tab instead of the full Control Center, and the map scrolls normally. You then have to grab that tab and pull it up to open Control Center fully. See this screenshot as an example:
I have an app with significant functionality triggered by dragging up on a small UI element at the bottom of the screen, and it's tricky to grab it in iOS 7 without swiping up from the bottom. How do I trigger the same Control Center behavior in my app? Is there a key in Info.plist that I can set? Or is that some kind of private API that Apple uses? It doesn't happen when the bottom toolbar is visible, so maybe it's some kind of state that can be set programmatically?
UPDATE: The same behavior occurs when you swipe down from the top of the screen as if to open Notification Center.
UPDATE 2: The camera app does the same thing, according to this question about UIScreenEdgePanGestureRecognizer.
I believe you have to hide the status bar for the grabber to come up first. That being said, I think users would expect Control Center to come up when they drag up from the bottom of the screen, so I'd say preventing that from happening isn't a very good user experience.

Remove/hide Full screen button from MPMoviePlayerController Standard Controls

I want to remove/hide the full screen button from MPMoviePlayerController standard controls as full screen mode is creating lot of problems and also not a requirement of my app.I just want the play,stop,forward,reverse controls. Can anybody help me?
There's no standard way to do this. Here are your options.
You could set the MPMoviePlayerController's controlStyle to None and create your own custom controls. Cons: this is a lot of work.
You could use the NSNotificationCenter to intercept the MPMoviePlayerWillEnterFullscreenNotification and immediately set fullScreen mode to NO. Cons: based on the iOS version of the user, this may cause a flicker or some glitchy effect.
You could go through the MPMoviePlayerController view's subviews until you get to a MPInlineTransportControls view which contains the controls, the slider and the play/pause button and the full screen button which are all of class MPTransportButton. Find that one and you can hide it or remove it from its superview. Cons: as of right now this passes app store reviews and works perfectly on all currently supported iOS versions. But this could change at any time. If Apple decides to redo their default video player you may end up with non working code.

Resources