When app comes back to foreground it shows splash screen - ios

When my comes back to the foreground, it shows splash screen for a while, like this.
This only happens on iPhone 6 and later.
If you have ever had this experience, sharing the solution would be appreciated!

That the splash-screen shows up for a moment before your app's UI comes up is normal. That is the whole purpose of the splash screen, to fill the small moment before your UI is ready.
What is not normal is the black screen with the red "background" text on it that comes up for a moment. That is not your desktop wallpaper, because that does not have the text on it. So that is likely something that you do in your app yourself.
I suggest that you concentrate your debugging efforts on where the black screen comes from:
set breakpoints in applicationWillEnterForeground: and
applicationDidBecomeActive: to see at what time the black screen
comes up
check your xib for any (hidden) black screen
enable slow-motion animations in XCode to better see what is happening

Thanks guys, I found the reason.
-----reason-----
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(NSIntegerMin, NSIntegerMin) forBarMetrics:UIBarMetricsDefault];
-----change-----
[[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60) forBarMetrics:UIBarMetricsDefault];

Related

AdMob using in splash screen

Bview=[[ADBannerView alloc]initWithFrame:CGRectMake(0, 0,320, 100)];
[Bview setBackgroundColor:[UIColor redColor]];
[self.view addSubview:Bview];
The Above code i used for displaying iAds.
Is this possible to adding AdMob or iAds or any other advertisement portions can able to adding / inserting of splash / launch screen using Xcode 6.0.
You can use splash screen as a rootview controller.
Add background image of splash screen on that view controller.That means your view controller will act as splash screen. Here you can add your code for admob.Otherwise it is not possible.
One more thing, if ad takes much time to display on splash screen, apple can reject your app.
Reference from apple document-
"As much as possible, avoid displaying a splash screen or other startup experience. It’s best when users can begin using your app immediately."

iOS 7 UIImagePickerView shows black preview initially

I am trying to call in a UIImagePickerView and sometimes when my camera view (with custom overlay) shows up it gives black preview initially. And after 15-30 seconds the black screens disappears. If the image is clicked with black camera screen, it still shows up in my UIImageView.
I followed up with the following similar posts:
iOS 7 UIImagePickerController has black preview
and
iOS 7 UIImagePicker preview black screen
I tried doing both. I have managed all the UI jobs on specific background thread and the getter method fix in the second link. But it was not fixed completely either way.
Here is another similar question explaining the problem I am facing, iDevice camera shows black instead of preview
I am still confused why is this bug actually occurring? how can it be reproduced? (as it appears sometimes only) and What's the right fix for this?
I ran into this same problem with the camera preview tonight, and the root cause of the problem was … completely unrelated code in the app delegate that modified UI on a background queue.
Once I eliminated the calls to UI code from background queues, the camera preview became fast and reliable.
This article ( cocoanetics.com/2013/02/uiview-background-queue-debugging ) was very helpful in tracking down where the UI was being modified from a background queue.

MFMailComposeViewController tintColor not working on device

I have an MFMailComposeViewController on an iPad version of my app that is acting up. I want the Cancel and Send buttons to be tinted [UIColor whiteColor], so I have set mailViewController.navigationBar.tintColor = [UIColor whiteColor]. This seemed to do the trick on the simulator, but when I run it on a device it shows up as dark gray text (which blends in with the bar's background and makes it impossible to read). Other things I have tried:
[mailViewController.navigationBar layoutSubviews] after it is presented.
[mailViewController.navigationBar setNeedsDisplay] after it is presented.
And also doing both of the above for each subview of the navigationBar. Any suggestions?
Thanks
there is no working solution. they mail VC isn't part of your app. that is the point of remote vcs. ergo they can't be customised.. or only in very limited way.
see iOS6: MFMailComposeViewController slow to load and flashes black screen; MailCompositionS begins hogging memory

iOS remove view before applicationWillEnterForeground

I'm developing an app on iOS 7 with a desired feature is that
When I home button, app enter background, I will add an image to current UIWindow. So when app enter background, if user double home button on iOS 7, os will show a small screenshot of current view of my app, so user can see my added image. :) (I did it)
When user return my app by clicking app icon, I want to remove this image immediately. In this situation, "immediately" means that user can NOT see this image anymore, user just see his/her current view when app enter foreground. I try to place the code remove image on the beginning of applicationWillEnterForeground delegate, but I'm still able to see this image for a short time after it disappears.
I also try to set hidden, alpha property for this imageview first, then removeFromSuperview, but it not works.
Can anyone help me to remove it "immediately" as my desire.
That is done automatically for all applications, you don't need to do anything in you code.
I don't think that you can do it faster, it depends of device performance. Sorry man.
Like other says it is really tricky how iOS handles these events. I've been researching and depends on the memory state of the device to do it faster or not. Indeed, in iPhone 4 and 4S may not show the image that you added on applicationWillEnterForeground method.
If I were you I would solve it by adding a smooth fade out animation of that image when the app becomes active again. With [UIView animateWithDuration: animations:] it could be nicely done! :)
If I find out something else I'll answer here!

How can I get a transparent background in my iOS app so I can see the Home Screen wallpaper?

I’m fairly sure this is going to be straight forward in that it’s probably not possible.
Basically, I’d like to be able to lightly see the background wallpaper through my view in the same way that the new Newsstand app does.
I've tried changing the alpha value of the view, and the background color to clear, but neither of these seem to do it.
Apple has removed the ability to use this api in 7.0.3. What a shame.
You certainly can in iOS7, at least as of a few days ago. In our app once you set the following it makes your background transparent and shows the user wallpaper. If you try to programmatically take a screenshot, it will just show black instead.
Set UIApplicationIsOpaque to false in the project plist
In the app delegate load function:
self.window.backgroundColor = [UIColor clearColor];
self.window.opaque = NO;
Set the UIViewController.view's background color to [UIColor clearColor]
Good news. From iOS 13, the background transparency can finally be enabled for all third-party apps. It’s no longer a private API.
In your app’s Info.plist file, set the boolean value for
UIApplicationIsOpaque to NO.
And now the user’s wallpaper is visible inside your app.
It's not possible in iOS. While your app is running it does not mean that there is home screen behind your app.
However, If you do want to do it, there is a way that you make your app go in background, take screenshot and use that image as your background which will feel like home screen.
See this post. In this link, the accepted answer gives a way to take screenshot of home screen while your app is in background. But that's been achieved through a private API, which means your app probably will get rejected by App Store on time of submission.

Resources