I am using Xcode 4.3.3 and storyboards i have a UITableView but when the device orientation changes from portrait to landscape the spacing is all messed up i also do not have a .h or .m file for my tableview because the cells are static any help is appreciated
Modify the struts and strings of your cell, label, etc in the size inspector of the utility navigator (Select what you want to modify and press Command-Option-5). In the box labeled Autosizing, select and deselect the connectors and arrows to make the item show up in the correct way. The Example box on the right shows you what the item will look like when your orientation changes.
Related
I have been having a problem with the Xcode8 storyboard. Whenever I embed a table view in a navigation controller, the various items (labels, buttons, etc.) that I drag into the cell will have a weird vertical offset. Basically, if there is a label in the cell, I will have to click below where it actually is to select it. Anybody else ever had this problem?
In Xcode 7.3, when I drag in a Table View from the Object Library to the Storyboard for a single view app, it doesn't automatically expand to the full size of the view. I seen it do that in my Udacity class videos and in other videos on YouTube. Is there a setting in Xcode that will correct this? Thanks.
Yes, you need to "pin" the tableView at the ViewController. Am I right you have a simple ViewController and add a tableView to it?
Now, you need to open the Pin Menu and uncheck the checkbox "Constrains to margins". Now you add the constrains to the top, left, right and bottom to 0 and save it. Now the TableView should stretch the whole display.
If you only show a table in the ViewController you should use a UITableViewController.
I have an NSTableview on the contentview of an NSWindow. When I resize the window, I would like the height of the NSTableview to resize. This isn't working.
To make sure I haven't set something incorrectly, I created a new mac project, view-based, storyboard. In IB, I added an NSTableView to the view. It looks like the default is to have autoresizing on, so I made no changes. Run this sample project, resize the window and the tableview does not resize. I guess I am missing something. What is it??
BTW, I am using xCode 6.3
• While viewing the xib, select the Bordered Scroll View that contains your table.
• In the lower-right of the xib canvas, you'll see 4 icons. The 2nd icon is called "Pin" if you hover your mouse over it. Click that.
• In the view that pops up, click the 4 red constraint connectors, then click "Add 4 Constraints".
All,
I'm using the Xcode 6 beta to build an iOS8 project using storyboard and swift. In the storyboard, I've created a Table View Controller as my primary view when the application loads and have added a label to the first cell and a label to the second cell.
The table looks fine in the storyboard, but when I run the application, the cells overlap. This is a brand new project with no other changes made or code added.
You can see both the storyboard and the running application in the photo below. Any ideas on what could be driving this?
Additionally, when I try to add a button to one of the cells, I get a grey box that covers 90% of the view.
I think I've had this issue. Try making some Auto Layout connections from the label to the Content View of the cell, and from the table view (and its cells) to the containing view, to force the views to be the proper size.
The following worked for me.
Control-click and drag from your label to left side of the cell it's in. When the modal comes up, check the box for 'Leading Space to Container'.
Repeat the same Control-click and drag process for each side of the cell, selecting the relevant Auto Layout option when it appears.
(Optional) Try to Control-click and drag from your table view to the each side of the containing view (if there is one), and repeat the steps from above.
Hopefully this works for you.
I find that I can't find this element on the XIB. How can I create this thing on OS X? Thanks.
That's a bottom bar with a label (text field) control in it. In IB, select the window, then select the Size inspector (⌘-⌥-5). There, you will find a Content Border pop-up menu. Select either Small or Large Bottom Border. Then, drag a label control into the border area. Then use the normal techniques to set the content of the label. For static content, you can just edit it in IB. Otherwise, you can use bindings to do it or set up an outlet and set it programmatically.
Are you talking about NSPathControl, which does exist in Interface Builder:
And here's an Apple sample project that might help you out.