iOS7 issue with container view - iphone

EDIT**: Although someone has decided they would like to down vote without a reason I'm going to leave this up. I noticed that in viewDidLoad of my view controller container, the content view I setup was the same size as in IB. When I later tried to load other views with my view container controller, the content view had changed it's bounds. Hope this helps anyone else that has a similar issue. The excepted answer worked. Since this is a build for iOS 6 a simple check of OS version made this an easy fix.
I have a strange issue that seems to be iOS7 related. This is an iOS6 targeted app. I have followed apples own docs about creating custom container views here. The problem I'm seeing in iOS7 is the first view I load is within the proper bounds of the content view i have defined, the other two are filling the bounds of the entire screen so it hides under the navigation bar with my segmented control. I defined the view I'm loading in a separate view controller in storyboards. Is there some sort of constraint that is working against me?
I should add that I have noticed the content view I defined in my container controller is actually changing it's size after the initial view is loaded. I'm at a loss of how to stop iOS7 from changing that UIViews frame size when it really shouldn't be changing.
Here are some screenshots. Code is pretty much the same as in the apple docs, have tried a few other ideas, defining bounds etc. but I think it has something to do with IB since the content view is changing its bounds. It appears to only be doing so in iOS7.

There is actually a proper way to fix this,
Set edgesForExtendedLayout to UIRectEdgeNone for the view under the tab bar.
Of course, I might've just looked at the pictures and assumed this was your problem...sorry if its completely unrelated..

That's a known 'issue' in iOS 7. Since you can now have a blurred look through the UINavigationBars, UITabBars, ... This also causes issues in native apps (e.g. the Photos App) or APIs.

Related

Best way to show a small view/dialog over an existing screen?

All my views/pages in apps so far have been full screen UIViewControllers that i push and pop from the stack.
I see some apps create a new view/window that appears about the 1/3 the size of the full screen on an iPad, containing tables of items to select or other UI elements. They are commonly used to allow users to filter the current view they were on.
Seeing them in apps, I guess that they are just adding a UIView to there current screen and change its frame depending on where on the screen they want it to appear.
Or am I wrong? Is there another/better way to do this?
I guess you are talking about UIPopovercontroller. There are several tutorials to build the same.check this. Hope that helps you.
It's a little unclear from your question what the view looks like.
If the view is "attached" to a UI element (has a little triangular arrow connecting it to, e.g., a button) and goes away if you tap outside it, then it's a view presented from a UIPopoverController.
If the view overlays everything and dims the content behind it, is likely a model view controller presented with a presentation style of ether page sheet or form sheet.
Both are common and easy to set up. See the class documentation I have linked.
In most cases, these are probably normal modal view controllers whose modalPresentationStyle property is set to either UIModalPresentationPageSheet or UIModalPresentationFormSheet.
Yes you can make your own UIViews and just add them as subviews. Another option for iPads specifically is with the UIPopoverController class.

display iPhone-View in a UIPopoverController on iPad (iPhone SDK)

i'm porting at the moment a iPhone-App to iPad.
I have to redesign some views but some views i want to present in iphone-size as popover.
Popovers are working well, but the content in the view in the popover has a wrong position.
There is a white border around the view an all UI-elements have a wrong position.
How can I make a correct position?
The problem was a missing target-membership of the NIB-Files to show.
I added the nibs to my ipad-Target and it worked.
But there is a new problem: It only work every second build.
Every second build there is the old error.
Have anyone an idea?

displaying a smaller UIWebView as a form sheet

I'm trying to pop up a UIWebView on iPad with a web site that is specifically sized for the iPhone (320x480). I want the web view to be centered, and transition in using a zooming animation. Other apps have this functionality, but I can't seem to find out how to do it. I've tried various combinations of presentation & transition style, but no matter what I do, the web view takes up the entire screen and slides vertically to cover the screen. I've made the web view 320x480 in IB, and am using UIModalPresentationStyleFormSheet, which should make it at least slide up into the center of the screen using a small window, but that is not occurring.
anyone know what's wrong?
Are you setting the property of the parent UIViewController or the modal UIViewController? Because you should be setting the properties of the modal UIViewController before presenting the controller instead of the parent.
This might be no help at all because you're doing the right thing, but it was the first error I made when starting to use MVCs.
maybe any of the autosize property is set. just do one thing bind your webview with the code and through code try to set the frame. Hope it will work as it worked many times to me when i faced similar types of problem.
hAPPY cODING...

UISegmentedControl not expanding size for navigation bar/very squished

Running through an iPhone SDK book and one of the examples has me creating a table and then later adding a UISegmentedControl to the table for sorting.
I dutifully did this in IB, and it looks great:
IB Screenshot http://img.skitch.com/20100529-83sefni21q4nj51rw1mghh2yj1.jpg
When I run it in the simulator or my phone, it's totally squished:
Squished http://img.skitch.com/20100529-x3pmr7gkb6xpm766bupi7quy55.jpg
The buttons work perfectly, it's just they are not sizing according to their content. Any ideas what's going wrong?
Here's the attributes I have set:
Attributes http://img.skitch.com/20100529-tp4d69bk8x98c6sjpmcne92etb.jpg
You could try explicitly setting the width of each of the segmented control's components. Click the Size tab at the top of the inspector and set the width for each component.
I experienced the same issue once. The problem was that the UINavigationController's view was not the top-level view in the hierarchy (it was not added to UIWindow directly), but it was added as a subview to another view controller's view instead. It's just a guess, maybe that's your problem, too (or that there are more than one visible view controllers).
OK, so in attempting to implement #Chris Gummer's answer, I seem to have learned more about how the Size->View Size property panel works. The default is:
Default Sizing http://img.skitch.com/20100529-gg9dwq5em3557yb1d6d721hpn4.jpg
and this is not a good default, it would seem. My book didn't mention needing to adjust this, so I didn't look at it. Setting the inner horizontal arrow of the box (which I guess means "fit width to available space") did the trick:
The Answer http://img.skitch.com/20100529-xt1bqghb4kbm2pbcqf1i1uygab.jpg

UIPageControl render quirk with UIScrollView

I'm building an iPhone application and like most I am trying to implement a UIScrollView with a UIPageControl, however I am coming across a very quirky behavior, which I assume may be a bug. Hopefully one of you has seen this before because it is driving me nuts.
Basically, the page control works fine, everything is hooked up and works normally on all accounts EXCEPT, with certain placements of the UIPageControl within the UIView, the UIPageControl will cease to render.
I'll just take screenshots of the XIB window to help illustrate... here's a placement that works perfectly fine:
http://www.jasconi.us/prob1.png
The UIPageControl is placed physically above the UIScrollView. Works great, everything is visible and working.
The next two DO NOT work:
http://www.jasconi.us/prob2.png
http://www.jasconi.us/prob3.png
The first one is simply placed below the scroll view. Doesn't render at all.
The second one is placed above the scroll view without technically being inside of it. Also doesn't render.
What the hell is up with this? I've tried using
[[self view] bringSubviewToFront:pageControl];
...to no avail.
Any ideas?
OK I found the answer to this, it's a little six degrees of Kevin Bacon.
This isn't actually a software bug, but a XIB quirk, for some reason the lower placement of the page control in combination with the default settings for autosize and anchor seem to jettison the control into outer space.
If you turn off all auto-scaling and auto-sizing and auto-anchoring and all that other crap, the controls appear exactly as you expected. The fact that it appears reliably when placed above the ScrollView is an oddity.
shrug.
Hope this helps future iPhone initiates.
Did you check to make sure that numberOfPages is not 0?
If you set a breakpoint can you see that pageControl is not nil?
I was still encountering this exact same problem, even after trying everyone's posted answers. My issue ended up being a little more "DOH":
I was using UIPageControl at the bottom of a modal FormSheet, however, I forgot to set the size of the view as Form Sheet in the xib. This caused my page control to be off the screen and never visible.
Moral: set view size (Full, Form, Page, etc) in your xib on the base view.
This will sound like a real no brainer, but I got caught out by it.
By default, UIPageControl expects to be on a dark background. IE: The dots are light gray, and white for the current page.
I used UIPageControl on it's own with no scrollview to change the time range of a graph I was rendering with drawRect:
Long story short, the graph background was white, so the page controller worked, I just couldn't see it. The solution was putting the graph itself in a subview, and making the parent that contained the page control have a dark background.