UIWebView showing black screen while lock the iPad device - iphone

Our app is based on the UIWebView. I have got fully black screen When i locked the iPad device while the PDF document is loading in the UIWebview. Please let me know that how to resolve this issue?

in your
- (void)applicationWillResignActive:(UIApplication *)application
you need to add some code to either reload the PDF if it's currently showing the PDF, or pause the loading.

Related

Play video on landscape and force app return to portrait

I used MPMoviePlayerViewController to play a video and when back to app, I need app force return portrait
I think the best way to solve this is by using
https://stackoverflow.com/a/13800907/620197
These are callbacks who only gets called when the user autorotates - you can tell the user to rotate the device and then the autorotate callback will be called and will show only the supported orientation.
If you still want force rotation i believe you need to dismiss the controller - try this and please do tell me if it worked out for you:
IOS 6 force device orientation to landscape
I have searched the web for a long time for a force rotation solution that will please me with no success, it almost looks like apple
Doesnt want us to be able to so this.

iPhone screen shifts when entering foreground

I've noticed that when my iPhone app enters the foreground after being suspended on an iPad2 (iOS version 4.3.3), the iPhone screen seems to shift up by a small amount after a split second. My understanding is that iOS takes a snapshot of the screen before suspending the app so it can quickly bring it back up when resuming, but it's not clear to me why it would be shifted. The status bar placeholder and iPhone image don't shift up, only the rest of the iPhone screen does. I don't see this problem in the 5.0 simulator.
Any ideas what's going on or how to fix this? Thanks
When the app loads, it displays the default.png file that you have in your app bundle. If you have this image the same as whatever the first screen of your app is (which apple suggests that you should do) then it is displaying this image, and then the actual screen once the app is done initializing. You can edit the png file by shifting up a pixel or two (you'll just have to guess and check to see exactly what you need).
The other possibility is that your default.png isnt the right size, so it is being resized when the app actually starts. Check that the dimensions are correct for the device you are testing on.
Setting the status bat to initially hidden caused this for me.
Status bar is initially hidden YES
This fixed it
- (void) setStatusBarVisible: (NSTimer *)timer
{
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
[NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:#selector(setStatusBarVisible:) userInfo:nil repeats:NO];
}
It appears that setting then reseting (after a short delay) the status bar addresses this issue.
This fixes it but it shouldn't happen in the first place.
yes it happens when you come again to foreground. it happens with me & i have solved this issue by using
(void)layoutSubviews
that means i draws the things in layoutSubviews method which shifts & it works fine.
for more information on this check my problem & solution

iOS view offset after youTube video execution

I am calling a youtube channel on a UIWebView. When user selects a video, device launches its video player as normal. However, when video ends or user finishes it returning to view, an offset is applied to whole app!! All views have an offset on top but this only happens on iPad and iPad simulator with compatibility mode, on iPhone and iPhone simulator not! How to solve it? Thank you.
Problem is that status bar dissapears after video execution.
[[UIApplication sharedApplication] setStatusBarHidden:NO]; problem is beeing solved when an event is fired using NSNotificationCenter

Animation/Video as launch images ios

Does anyone know if it's possible to show a video or an animation instead of a regular launch image in ios? The app's like D&G and Mango did this but I can't seem to find how. Is this maybe not an actual launch images, but a video which in triggered in the didfinishlauncingwithoptions.
Thnx!
Wel after the app hit the - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions you can setup an animation.
There is no way to do this before this point.
The os just looks for the Default.png in the bundle and displays it als long as your app is starting up. (read not returned from the above mentions method).

iPad rotation bug when using MPMoviePlayerViewController

Issue summary
Changing the orientation of an iPad device or simulator while playing a video using MPMoviePlayerViewController results in an inconsistent rotation state upon dismissal of the video player. This is a known bug in iPad SDK 3.2, documented at http://www.openradar.me/8012810
Sample project
I have prepared a minimal sample project using the View-based Application template from Xcode 3.2.2, using the following code to launch the player
NSURL *movieUrl = [NSURL URLWithString:#"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"];
MPMoviePlayerViewController *player = [[MPMoviePlayerViewController alloc] initWithContentURL:movieUrl];
[self presentMoviePlayerViewControllerAnimated:player];
[player release];
The code is available on GitHub at http://github.com/adamalex/FullScreenMovie or direct download using http://github.com/adamalex/FullScreenMovie/zipball/master
Steps to reproduce
Obtain the project using the information above
Launch the project with the iPad simulator or device
Tap the button to begin playing the video
Rotate the iPad by 90 degrees
Dismiss the video
Note the UIStatusBar is out of sync with the application UI
Objective
I have contacted Apple and they have confirmed this is a bug that is being investigated. I would like to discuss temporary workarounds that use public APIs safe for submission to the App Store. I am going to open a developer support case with Apple as well and will report back with my own progress.
Successful response from Apple Developer Technical Support!
This is a known bug and a we're received a number of duplicate bug reports and so iOS engineering is aware of the issue and we do have a temporary workaround as suggested by iOS engineering.
You will need to implement this in the view controller which presents the movie player.
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
[self performSelector:#selector(fixStatusBar) withObject:nil afterDelay:0];
}
- (void)fixStatusBar {
[[UIApplication sharedApplication] setStatusBarOrientation:[self interfaceOrientation] animated:NO];
}
While this is somewhat ugly, it should fix the issue for now. It would be recommended to remove this code once the bug is fixed in the system.
This took care of the issue completely for me, and you can revisit http://github.com/adamalex/FullScreenMovie for the code with the fix applied.
This also solves an iPhone/iPodTouch rotation issue that I was struggling with. I am developing a universal app in which each view displays a different image depending on whether the device is in portrait or landscape orientation. Buttons are used to navigate between views.
If the app is running on the device and a portrait view is rotated to landscape, my image switching takes place. If the device is then placed flat on a table top and the button is tapped to display the next view, the view appears in landscape but shows the portrait image instead. I solved the problem by forcing a portrait view to appear by detecting for face up and down, but Apple's code solved this problem (as well as the similar movie problem I was also experiencing).
Many thanks for reporting the bug - I assumed it was just my bad coding...