How can i show UITableView
Rows only which contains data not the other rows. By default UITableView
shows 10 rows. If we have data for three rows It will display three rows only
How can I implement this? Thank you.
add an 'indexPath` property to the custom table cell. initialize it in cellForRowAtIndexPath. move the tap handler from the view controller to the cell implementation. use the delegation pattern to notify the view controller about the tap event, passing the index path.
Methods for managing selections, configuring section headers and footers, deleting and reordering cells, and performing other actions in a table view.
deselectRow(at:animated:) Deselects a row that an index path identifies, with an option to animate the deselection.
You can set a footer view and make it invisible if you want. Separators will appear only for rows which contain data:
self.theTableView.tableFooterView = [[[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 10.0f)] autorelease];
Try this ..
self.tableView.tableFooterView = [UIView new];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With