Number of Cell prototypes exceeds tableview height - ios

I have a tableview that has a large number of fairly tall dynamic cells. I've tried creating the prototypes for these but I've run out of height room in the view.
I can't seem to extend the height of the table view, (or the view it's in). I also can't create the tableview outside the viewController, give it a larger height, and just link to it.
Suggestions? I know I can create the cells programmatically or from a separate nib, but I'd really like to do it via storyboard.
thanks,

Just figured this out myself. Try this:
Double-click the table almost anywhere except where there's an existing control. You can also double-click on the outer edge of the table.
Note that the table view will show a highlighted section that aligns with the cell you've clicked. You've entered some sort of selection mode.
Now use the mouse to scroll up or down. The cells will shift up or down as if you were running the app.

Related

How to place UILabel exactly below UITableView?

I have UITableView with height of ≤500. Tableview data comes from database. Below UITableView, there is one label and two radio button. The problem is if data in the UITableView is less than its height, then it shows blank space between UITableView and those two radio button. I want to place those label and radio button exactly below tableview. How should I do this ?
This is how my tableview looks
If the table view's height does indeed vary depending on shown content, you could use UITableView's tableFooterView.
For a bit more context see this post for example.
Alternatively you could do this with basic auto-layout by tying your label and radio buttons (that you place as siblings of the table) vertically to the bottom of the table view.
I could also imagine that you may need a section footer. So you may want to have a look at that too.
If you want it to be scrollable, add it as the last row in your table view. You may also go with table view's footer.
If you want it to be sticky at the bottom in case of more rows, go with auto layouts. You may create outlet of table view's height constraint and adjust that accordingly depending on the number of rows. However, this approach is not appreciated.

How to set Table view cell to occupy entire screen?

I am working on a project to get custom news feeds from Bing news. I created a custom table view cell and populated various UI items in it. But I am having a hard time to make it occupy the entire screen, it starts from extreme left and ends on the right, leaving large gap from the right margin as show in the image. Can anyone help me out, how to correctly fix it with a detailed explanation of how constraints work in Table views and Tableview cells.
Here' what it looks like in the simulator
Remove previous constraints and add constraint to your UITableView like as shown in below image.
So you UITableView will have 0 margin from edges.
Create a UITableViewController. Just drag drop a TableViewCell into it. Add identifier for that cell and use it. By default it will occupy the whole screen.
In your case I guess you might have added constraints to UITableView. Here what you should do is pin your UITableView to Top,Bottom,Right & Left or make UITableView's width equal to SuperView.

I want to see all the cells in static table view, which don't appear on the screen in the storyboard

I'm currently studying iOS programming in Swift. In creating a static table view, changing the Rows option more and increasing cells' height while designing them, there happens to be a problem:
The table doesn't scroll vertically in the storyboard. So it doesn't show all the cells I assigned in the Row option. I have more cells to work on. How can I handle this?
You can see by following way
Select the controller in the story board
Go to size inspector and make it freeform , then you can increase the height of main view and can see the full content.

UITableView with Horizontally wrapping cells

I am looking for how to, in Swift and Interface Builder, create a UITableView in Xcode where the table has a set width (example: padding to left and right edges of superview might be 8). In the table, I want cells to go across the first row. When a new cell can no longer fit in the first row I want it to go to the second row. When a new cell can no longer fit on the second row, I want it to go to the third row, etc. I only want the table to scroll vertically.
If anyone can point me to examples or documentation on this I would greatly appreciate it.
You are looking for UICollectionView.
http://www.raywenderlich.com/78550/beginning-ios-collection-views-swift-part-1
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UICollectionView_class/

Is is possible to control the speed and scrolling of a UITableView

I've got custom tableview cells that are 170 px tall. Including the table header I can see two complete cells and a portion of the third. When I scroll the tableview, the cells shift up but do not stop until a portion of the third is above the table.
Is it possible to change the way the table scrolls and allow me to see all of the third cell. A video illustrating the issue is available at https://youtu.be/iuhuR_wDe90
Images of the issue:
It seems you have enabled 'pagination' on your UITableView.
You can get rid of this in Interface Builder, in the Scroll View section there's an option called 'Paging Enabled' which should be switched off.
If you don't use storyboards, tableView.pagingEnabled = NO; will do the trick as well (though it is NO already by default).

Resources