View Stretched in Storyboard iOS - xcode

can anyone tell me how to get my storyboard back to normal? I'm not sure what I did but all my views seem to be stretched and I can't see the navigation bars at the top of them where I need to make changes to buttons I've put up there.
full size screen Shot of Xcode

I do not know the cause, but I had this problem a while back.
In my situation I had a TabBarController pointing to several navigation controllers. To fix the problem I just deleted the TabBarController and replaced it with a new one.
If you have no TabBarController I would try just replacing the first NavigationController where the stretching takes place and it should fix all subsequent View Controllers.

The simplest solution is to roll back with your version control system.

That happened to me too. As Jeremy responses I had a tabBarController but I fixed by deleting the viewControllers associated to the tabBar, 1 of them was the one causing the problem, it was a Navigation controller wich I've changed the title, so the title was a little big and that did the controller to expand.

Related

Trying to Change my ViewController to full screen but can't

I know there are many questions and answers about how to make a ViewController full screen. My problem is little odd. I am not using Navigation Bar and when I try to set my modalPresentationStyle to fullScreen my View is showing and than hiding.
This is probably due to code you have not shown us, such as a bad viewWillDisappear in the previous (select place to ride) view controller.
You didn't experience the issue before because a presented view controller that isn't full screen doesn't cause the previous view controller to disappear.

UITableviewcell width not filling the screen

I don't know if this is a bug with AutoLayout or Xcode but I've realised that if I run my application on a device which isn't the same size as the device in my storyboard, the elements are adopting the incorrect size.
I.e. Selecting View as iPhone SE and running the application on an iPhone 7+ The size of my tableview is the width of an iPhone SE screen, this fixes itself when I reload the view and then it then adopts the width of the iPhone 7+ screen.
Just a note as well the table view doesn't have a fixed width and is pinned to the top, bottom, left and right with 0 spacing and also I'm changing the height of the cells programmatically in code if this could affect it at all as well.
Video: https://drive.google.com/open?id=0B0QLbDLfJn6_YzljUGg4RTUwaTg
Views that come from a xib (or storyboard) have their IB frame values when they are created, before they are added to the view hierarchy. So a case like you describe is probably that something is accessing a view loaded from a xib before it has become part of the layout process and resized.
This would also explain why it's fixed when you go away and come back. The first time, it got the values before they were final, but the second time the values are already final and correct.
Layout code called fromviewDidLoad() for view controllers, or awakeFromNib() or initWith(coder:) for views is the likely cause. Layout code called from viewDidLoad() is especially problematic because it was fine up to iPhone 5s, but would now cause this problem.
It's impossible to say what exactly the issue just from this. From the NSLog statements visible in the video, the issue is whatever code calls that "weather view width". That is being called too early in the layout process. It needs to go in viewWillAppear or viewWillLayoutSubviews to make sure the correct values are ready for whatever calculation is dependent on that. Hope this helps.
I can't seem to recreate this. I would recommend double checking for any updates for Xcode and the Developer tools (softwareupdate --install -a).
Incase you haven't, restart Xcode.
EDIT: Disregard this answer, please read Mike Sand's post.
Try self.view.layoutIfNeeded in viewDidLoad or in viewWillAppear

Split View Controller showing only one view (Xcode 6)

I'm trying to get the split view controller working properly but apparently there's a bug in there or I'm missing something.
First of all, I've started a blank OSX Obj-C application, and in the Storyboard I've dragged the split view controller. Next, I've linked the segues from the main window controller to the split view and added two labels.
http://i.imgur.com/dlFObaF.png
When I build the project, it shows only the second page. Not to mention strange window size in the final build.
http://i.stack.imgur.com/IqRqr.png
I've tried everything.
This occurs in both vertical and horizontal split view.
Any suggestions?
I had the same issue myself today, but it's just the split line wasn't initiated properly.
To see, this, once you run your app, move your mouse toward the edge of the window and drag it, you will now see another view emerging.
To my best knowledge, I do not know how to fix this in IB or in code. Apparently NSSplitViewController does not have a property like UISplitViewControllerAutomaticDimension. Would appreciate if someone can contribute to this.
Edited: Found an answer via another thread. Basically, try to add some constraints to the subviews inside each view and that should prevent the size of a view to be zero. In my toy example, adding margin constraints to my buttons worked out well.

IOS/Xcode: storyboard screen turning black

I am just learning Xcode. I did something that caused a view controller to turn black below the navigation bar when you build app.
It looks white in storyboard.
Also, when I pull a label onto the storyboard, it aligns to the left margin and does not show the drag boxes around it.
I may have inadvertently clicked something but when I compared it in attributes and identity inspectors line by line to another project, nothing seems amiss, i.e. everything is the default value.
Has anyone run across this?
There is not code in associated class that would cause this as it is generic i.e. plain vanilla.
Would appreciate any suggestions. Thx.
With that little information i'd say you removed the root view of the controller?
Either way, you say there is no code, so I'd suggest you simply delete that controller and create another one (bottom right, objects, viewcontroller). Since it's empty you're not gonna lose any data or time :)
Then link it to your class in the Identity Inspector and you're good to go as if it was a new one.

UIViewController leaving Space in bottom

I am upgrading an old project from iOS4 to latest ios8. There are 2 or three view controllers that don't look right, the navigationbar seem to cover portion of the view and also leaving space in the very bottom. I can't seem to figure it out no matter what I changed for settings by removing/adding topbar/statusbars/bottombars, the xib file looks alright, but not when I run it on simulator or device. Here is a screenshot of what it looks like.
If I see this right, it is an UIImageView holding the backgroundimage... ?!?
I can only guess, but you should change the UINavigationBarStyle from translucent to opaque... That will bring everything lower, where it was supposed to be.
Click on this viewController in Storyboard, uncheck the box for "Under Top Bars" and check the box for "Under Bottom Bars" in the Extend Edges Settings. This should solve your problem!

Resources