Why am I getting a blank slate after the iOS loading screen? - iphone

My app is displaying the correct iOS loading screen, and then a white screen.
Is it incumbent on me to overwrite the white screen appropriately? Before I added loading screens, I had a background view loaded, and images on top of it. Now it just is plain white.
For displaying the background correctly, does it make sense to have a draw screen method, called from viewDidLoad and from viewDidRotate, and tackle things from there?
I have a ContainerView under a ScrollView, and the ScrollView is provisionally 150x150, which should even if it clips things show non-white pixels inside.
What should I do to get real diagnostics?

My app is displaying the correct iOS loading screen, and then a white screen.
Something is wrong with your initial view controller, or with the view that it's supposed to load.
Is it incumbent on me to overwrite the white screen appropriately?
The white screen is probably either your app's window or an empty view. Normally, your app delegate would create a root view controller and load its view into the app's window (possibly automatically if you're using storyboards). It sounds like something happened to adversely affect that process -- your storyboard was changed, your Info.plist (which points the app to the right storyboard or .xib file) was changed, etc.
For displaying the background correctly, does it make sense to have a
draw screen method, called from viewDidLoad and from viewDidRotate,
and tackle things from there?
That shouldn't be necessary, at least in the context of your current problem.
What should I do to get real diagnostics?
Use the debugger. Is the window's root view controller pointing to an instance of the correct class? If yes, does its view property point to the correct view? If yes, does the view contain the appropriate objects?

Related

How to get the visible view size in iOS13 when presenting a view controller

In iOS13, the default way when presenting a view controller was changed to the "sheets/cards" view. As I’m not using auto layout (why not, is not really important and relevant), I rely on getting position of elements based on the frame of the view.
Now, the problem with the new method is, that the view frame doesn’t really reflect the actual content size visible on the screen anymore. E.g. if I have positioned a UIButton at the bottom on the view controller based on the view.frame bottom coordinate, it will be now cut off, as the view is actually moved down in the amount of the nice "sheets/cards" visual indication at the top. The same problem is even more evident in an iPad, where centring another view in the view controllers view will be offset, due to the fact that the default presentation style is now a "sheet" in the middle of the screen.
I’ve currently changed everything to force the full screen version, but it would be nice to use the new fancy design.
Anybody has any idea how to get the actual visible rect/coordinates in the new style without changing things to auto layout?
Here are how they look. The "flower" is centered in the view and the X button should not be so close to the bottom or missing completely in the iPad version.
Finally figured it out. As I was setting the positions of items in viewDidLoad, the frame was not calculated correctly, thus resulting things being laid out incorrectly. When resetting the frame and positions in viewDidLoadSubviews, the positions were placed correctly.

Iphone View Rotation not functioning properly

I have a simple 1 screen app, with 1 View.. the view contains
a button, an textbox and a button across the top
A segmented controller across the bottom
and a MapView in between.
In portrait mode all is right with the world.. So I decided to begin to allow Orientation change...
in IB all views and elements and even the root window have autoResizeSubviews set
in My AppDelegate and my viewController I have also programatically added SetAutoResizeSubviews to yes explicitely I have set the autoResizingMask in the Root Window and the View Controller to FlexibleWidht | Flexibile Height
I have added the shouldAutorotateToInterfaceOrientation in my ViewController to always return true.
Yet, it doesn't work.. Or should I say it doesn't rotate properly.. in both portrait modes everything looks great, but both landscape modes, things don't get laid out or resized properly.. Basically all I see is the mapview, and its size gets slightly wider, but not much than the portrait mode, and it doesn't fill up the screen top to bottom.. all other interface elements with the exception of one button are invisible and it appears on TOP of the mapview.. as thought it just happened to be layed out over the view by coincidence than any design.
Anyone have any ideas what I am missing, or why?
Thanks in advance
You say "I have set the autoResizingMask in the Root Window and the View Controller" but that is a red herring. It is the buttons, the text box, the segmented controller, and the map view that have to have the correct autoresizingMask. If this view is being designed in the nib, you can set the values there and then turn the orientation right there in the nib and see what happens.
If you are unable to work out good autoresizingMask values for all those interface elements, implement didRotateFromInterfaceOrientation and perform the layout alterations in code when called upon to do so.

Why is there a 20-pixel-high dark overlay over my app's navigation bar?

Once again, I'm almost entirely sure this is something dumb that I'm doing, but I've been banging my head against this one for hours & am getting nowhere.
I'm trying to restructure the view hierarchy of my app. I need to be able to detect user interface orientation changes globally in order to correctly rotate a "Loading" view displayed when the app is downloading content. (device orientation changes seem to fire at different times, causing the view that needs to respond to these events to rotate sporadically).
The app previously added a UINavigationController's view to the main window. I modified the hierarchy to add the view of a UIViewController subclass to the main window, and added the view of the UINavigationController to the subclass's view. The UIViewController subclass manages the display & rotation of the "Loading" subview, and I was expecting the rest of the app to continue behaving normally, as inserting one extra empty view into the hierarchy didn't feel like I was changing too much.
My initial problem was the positioning of the UINavigationController - it was 20 pixels too low, resulting in a gap between the status bar and the navigation bar, and cutting off the bottom 20 pixels of the tab bar. I was able to adjust this by setting the frame property of the UINavigationController's view to the bounds property of the UIViewController's view, which corrected the position.
However, now I'm stuck with a 20-pixel-high dark "overlay" on top of my navigation bar. If I were to guess, I'd say it was black with 50% opacity. Touch events on this bar don't work (e.g. if I try to tap the "Back" button through the overlay, nothing happens). The fact that the height is equal to that of the status bar hasn't escaped me, but I'm at a total loss as to what could be causing it.
I hate feeling this stupid, so if anyone has any insight into this problem, you'd really make my day. Thanks in advance!
OK, a few things pop out from your post.
My initial problem was the positioning of the
UINavigationController - it was 20
pixels too low
This makes me believe it is related to your new problem.
I was able to adjust this by setting
the frame property of the
UINavigationController's view to the
bounds property of the
UIViewController's view
This sounds like the view it was loaded onto was offset 20 pixels, and when you set it to the bounds, it repositioned it on the windows view space.
Touch events on this bar don't work
(e.g. if I try to tap the "Back"
button through the overlay, nothing
happens)
This is the big thing. If touch events aren't being sent to the view, then what that means is that the OS doesn't see a view where you are pressing (or rather the view you want it to), so that view doesn't get the message to do something.
From what you have said, I believe your problem is with your base view controller that you just added. Try redoing the frame on, making it conform to where you want. Then take out the code you put in to set the navigation controllers frame. The navigation controller should fit to the view you added too, and once you have that main view where it needs to be (20 pixels higher apparently), then everything should work.

Resized XIB still full size

Building an iPad app. I have a button on my main view that I want to launch a help window. The help window is fairly involved and has its own xib/controller. I resized the help window's XIB and saved it. I instantiated it and added it to the application controller's views as a modal. For some reason this window is still taking up the entire screen.
What I really want to do is have a "view" that's maybe 70% of the width and height that lays over the normal view as a modal. How is this accomplished normally? I want it to require that they hit a button to close it.
Thanks
You could also try placing your UIView into another UIView that actually takes up the entire screen, but has a backgroundColor = [UIColor clearColor].
Modal view controllers are really intended to take up the entire screen, as Apple's description states "Modal view controllers are a tool that you have at your disposal for displaying a new screen’s worth of content" (http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/ModalViewControllers/ModalViewControllers.html).

How to get transition like Star Trek app?

I've modified the ViewTransitions app to use kCAScrollHorizontally. I've set transition in the app delegate to use kCATransitionPush rather than kCATransitionFade. However, I still get fading in and out. How can I get the views to slide in landscape just like the Star Trek app (http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=305916616&mt=8)?
I've done transitions like this before. Basically I have a big view that takes up the screen, with another view (the actual screen content) embedded within it. When I want to slide in a new page either from the left or right, I'll take the next page of content, place it offscreen, and embed it in the big backing view. Then I'll just animate (using a simple [UIView beginAnimations:context:] to change the frames of both pages simultaneously (really just changing the origins of the frames). The offscreen view slides to where the current view is, and the current view slides to an offscreen position. Once offscreen, I'll remove it from its superview. Works like a charm.
The simulator will still fade out rather than performing some complex transitions...
Did you try it on the device?