storyboard bug with UITableView? - ios

This may be me being stupid, but I'll ask the question anyway (at the risk of being down voted to death).
I have a UITableView in a view controller in story board. The size is width=213, height=559. Looks fine in storyboard.
In the ipad simulator (version 6.1) the table has width ~276 and height 559.
I have added no code at all (created a new view controller, dragged in a table, sized it to width213, added a button of width 213 just to have a place marker). Added a button elsewhere in my app that does a model to the new view controller.
I'm using xcode version 4.6.1
Any thoughts?

It seems I don't have any tableviews laid out in a storyboard, but since XCode 4.6.~ I have quite a bit of trouble with the "Autolayout" feature. I would try selecting the problematic table view, then under the file inspector, unselect "Use Autolayout" It seems ON by default now, and causes my .xib's and storyboards not to work as I would expect.

Related

Xcode 7 Beta 5 - All subviews missing from Storyboard

I've recently switched up to Xcode 7 Beta 5 and I've been trying to solve the UITableView issue that I know lots have experienced. One solution I found was to disable size classes, however, once I did that I wanted to roll back my solution to a commit I just performed before that.
After I discarded all the changes I was presented with my view controllers and none of their subviews visible in them. In the hierarchy to the left they are listed but are 'greyed out'. Can anyone help with solving this?
Screenshot for reference:
It's worthwhile noting that when the app runs all of the ui elements are still present as expected - just in storyboard they are not displaying.
Try checking it in different layout such as any width compact height.
Grey out generally means that your view are active on a particular layout.
You can see the changes when you tap in the bottom wAny hAny and select different sizes...

iOS8 Size-Classes and Popover Views

I had an issue with Popover on an iPad app I was working on recently...going to just post it here as I think it may help others.
I'm using Xcode 6 and iOS 8 and Size Classes and the Popover View was built in a Storyboard.
As my iPad App is in Regular/Regular Size Class all the time I built the Popover view in R/R too.
No matter what I did with Constraints though, the popover just never looked right, it was a mess. So what was wrong??
After some time the penny dropped to check the Any/Any Size class constraints.... These were matching the erronous constraints that I was spitting out in the logs. So I designed the Popover view in the A/A size class and it worked fine!
This might seem obvious to some but I thought that because my App was R/R that my Popover constraints should be in R/R. However it looks like that if you are using a VC as a Popover that the constraints need to be made in the A/A Size Class.
For me, setting size to Any-Any then re-setting to Regular-Regualr fixed it.

Invisible subviews in Storyboard view trees

In my view tree in Storyboard I just see my subviews greyed (in some other view controllers only part of them are greyed). They are not visible in Storyboard but work as expected in the app.
This is not really convenient to work on my views design. Any bright idea?
Tried
I have digged in my commits: nothing that seems relevant. The only weird view is that a couple view has an attribute misplaced="YES" I don't get why.
I have removed myproject.xcodeproj/xcuserdata, that doesn't change anything.
Thanks
Those are 'uninstalled' views. The concept of 'Installed' views (and constraints) was introduced in Xcode 6 along with the addition of size classes.
Basically 'installed' for a particular size class means the view will appear and be part of layout for that size class.
To make them not gray and re 'install' them, go select the views, go to the properties inspector, and click 'Installed' at the very bottom. The views should now appear fully opaque and will now appear at whatever size class in which you are currently viewing this nib.
Im not 100% sure as Xcode 6 is fairly new to me but i believe that when views are greyed out like this it means that in some size class sizes the views have been removed but not in all.
To test this if you click on the view thats are grey then check in attributes under view that they are installed on all size variations :D hope this helps.

Storyboard View Elements Greyed Out

I'm currently trying to edit a storyboard file, in Xcode 6 (not sure if this is an Xcode bug, or if i've just done something), and when I go to the view i want to edit this is what the scene shows me :
Is this something I've enabled accidentally? or if it's an Xcode problem. It first did this after I enabled source control for the project.
Anyone have an idea on how to fix?
The problem is probably related to Size Classes. If you have the option enabled make sure that the views were created for the size class that you have currently selected in IB (the grid thing).
If you want to make sure it works with any width and height, find the constraint:
and remove it by clicking on the x, leaving only installed checked:
I think Xcode will stop adding these automatically if you set the view to Any Width | Any Height in the Storyboard:
Check that Installed is checked at the bottom of the Attributes Inspector

UITableView Gap Xcode 5

I'm having trouble adding a UITableView to a UIViewController in Xcode 5 (DP4). When I add the table view and add a cell to the table through Interface Builder Storyboards, the table adds an extra white gap/space above the first cell. This seems to be happening when I embed the view controller in a Navigation Controller.
When I build and run the space is still there so it's not just a quirk in IB.
See the picture below to see what I mean.
https://www.dropbox.com/s/tgqolwmo02h91d6/Screen%20Shot%202013-08-20%20at%2011.52.27.png
This doesn't happen on Xcode 4.6
https://www.dropbox.com/s/8giyj2mjdhcrhy4/Screen%20Shot%202013-08-20%20at%2012.37.06.png
It looks like the Table View can't be the first child of the view controller's view. Drag it down below another view to fix the issue.
If you want more help, you'll need to go on Apple's developer forum (NDA, blah blah blah), but I'd say have a look at your constraints. Keep a backup of your XCode 4 story and upgrade it in XCode 5, you might see what is wrong.
When you add a UITableView to a blank view canvas it adds a 20 pt constraint to the top to account for the status bar. Embedding the UITableView in a navigation controller after this constraint was already set added this padding to the top of the UITableView. I found this constraint in XCode but no matter what I did I couldn't remove it. What I ended up doing was removing the UITableView from the View and then adding it back and the constraint was gone. The UITableView remained the first child of the view so I don't think that's a specific requirement.

Resources