UICollectionView bigger than NavigationController - ios

I have a UICollectionView embedded in a NavigationController which in turn is embedded in a ContainerView.
The NavigationController views frame width is correctly 964, but the UICollectionView frame width is still 1024.
I cant set any constraints, I thought it would fill to fit the nav controller, not be larger.
What am I missing?
UPDATE: I am using a UICollectionViewController and I am not using any code for this functionality, all done through the storyboard.

Ok, so I considered vacawamas question of whether it's a uicollectionviewcontroller or a uicollectionview. It prompted me to try the uicollectionview which then allowed me to directly apply constraints and it worked!
I still have no idea why the uicollectionviewcontroller didn't work but I'm learning developing iOS apps seems to involve using a lot of workarounds :(

Related

Subclass UITabBar without Storyboard to increase height

To my understanding, the only way to subclass UITabBar (to increase the height) in a UITabBarController is to implement a storyboard and assign the subclass directly via the interface builder.
I was wondering if it would be possible to simply swizzle self.tabBar to our own subclassed tab bar, but that probably wouldn’t work.
Any other ideas? I’m simply trying to increase the height of the tab bar, while not breaking or conflicting with the superview’s constraints.
I think you should go through all the answers given in the following link.
Change UITabBar height
In this example people have given ways to customize height without even subclassing.

UIScrollView scroll viewcontrollers broken autolayout

I have 2 view controllers which works properly good when I presentViewController them. Now, I've created a ViewController with a UIScrollView to scroll the ViewContoller as 'Scroll UIviewContoller Apple's Example' When I enter in HomesViewController (the controller which the UIScrollView that control the others UIViewController) the layout is total broken, size and positions. When I go out to another page and back again to HomesViewController, the layout is working, respecting the autolayout constraints. I have already tried to implement -(void)didAutoLayout and reload InputViews, but it doesn't work. I will not paste my code, because the ScrolLView works, when I go out from the page and back again...then I think its a problem with refreshing layout...
Look into UIPageViewController it is an excellent way to create a paged "scrollView" of view controllers. This is often used for things like app tutorials.
Apple has already done the work for you :)

ScrollView height for 3.5" vs 4" iPhone

I have a UITableView in a UIViewController which is inside a UINavigationController which is inside a UITabBarController.
When Developing using a 3.5" Simulator and having my storyboard set to 3.5" and everything works fine.
However if I use a 4" simulator, the UITableView ends too short up the screen. And if I do it the other way around the table view ends off the bottom of the screen.
How do I go about correctly sizing my UITableView?
(P.S. I'm not sure it matters, but I'm loading an AdBannerView which goes at the bottom of the screen, so I'm adjusting the contentInset of the UITableView after it is loaded to make space for the AdBannerView, but I don't think that makes a difference to this situation).
You need to add auto layout constraints so that the components are resized according to the desired logic.
Read Apple's Auto Layout Guide and you'll know everything you need in order to accomplish this.

Can't adjust autoresizing mask for viewController

I'm trying to adjust my app to iPhone 5, but I ran into some difficulties.
The header of the ContainerViewController (always stays on top)
The ContainerViewController that holds the other ViewControllers
SidebarViewController
ContentViewController
So, the container contains the header, sidebar and content views. Inside content view I have UINavigationController. My problem is when I use iPhone 5 it changes all of the application looks, even when I use Autoresizing Mask, it looks bad and not on the correct position, I think that it's maybe because of the container header that I created.
I set it like this:
And this is an example of the view that holds UIScrollView and UIImageView as background: (pay attention to the bottom of the UIScrollView and the UIImageView, it pushes them outside of the view.
iPhone 4:
iPhone 5:
This is the first time i'm using Autoresizing mask, so please be patient with me. Thanks in advance!
Am not going to answer this deep down. You have set the auto resizing wrong.
Here are things that will work. To deal with iPhone5 you just need UIViewAutoresizingFlexibleHeight as autoresizingMask
If you want to know properly about Auto-resizing read through this
For Container
For Header
For Content
For Side Bar

iPad SplitView TableViewController width

How do you change the width of the UITableViewController in an iPad SDK 3.2. It seems that it is fixed just like the iPhone UITableView.
I got your requirement what do you want to do in you application. Here you can carry out it in different way.
Instead of using UITableViewController, please use UIViewController and then add UITableView inside the UIViewController. Here you can change the frame size of UIView as you want. But you can't change the frame size of UIViewController as it is the base view and it will be the same as iPad screen. Please do like this and let me know if you have any questions or doubts.

Resources