Questions tagged [uitableview]

UITableView is a class used for displaying and editing lists of information on iOS. A table view displays items in a single column. UITableView is a subclass of UIScrollView, which allows users to scroll through the table, although UITableView allows vertical scrolling only.

UITableView is a class used for displaying and editing hierarchical lists on iOS () and watchOS (). It uses an efficient architecture that reuses existing UITableViewCell objects while they scroll offscreen, improving memory usage and performance during fast scrolling.

Sample of Use

Sample of Use

Resources:

64456 questions
171
votes
6 answers

UITableView, Separator color where to set?

I have added a UITableView in IB and set the "delegate" and "datasource" and all is working well. What I wanted to do next was change the separator color, but the only way I could find to do this was to add the method to one of the delegate…
fuzzygoat
  • 26,573
  • 48
  • 165
  • 294
170
votes
5 answers

Adding iOS UITableView HeaderView (not section header)

I want to add a table header (not section headers) like in the contacts app for example: exactly like that - a label beside an image above of the table. I want the all view be scrollable so I can't place those outside of the table. How can I do…
AMM
  • 2,195
  • 2
  • 20
  • 28
169
votes
8 answers

What is the default height of UITableViewCell?

I thought this information would have been easier to find :-) What is the default height of a UITableViewCell? It looks like 44 pixels, but I'd prefer to be sure.
Rob
  • 25,984
  • 32
  • 109
  • 155
165
votes
24 answers

Add swipe to delete UITableViewCell

I am making a CheckList application with a UITableView. I was wondering how to add a swipe to delete a UITableViewCell. This is my ViewController.swift: import UIKit class ViewController: UIViewController, UITextFieldDelegate, UITableViewDelegate,…
jdnoon
  • 1,845
  • 3
  • 15
  • 18
164
votes
16 answers

How to set the full width of separator in UITableView

I have a UITableView where the separators don't have the full width. It ends like 10 pixels before the left side. I was playing around with this code in the viewDidLoad(). self.tableView.layoutMargins = UIEdgeInsetsZero; Also in the storyboard when…
Timo Cengiz
  • 3,367
  • 4
  • 23
  • 45
164
votes
13 answers

Async image loading from url inside a UITableView cell - image changes to wrong image while scrolling

I've written two ways to async load pictures inside my UITableView cell. In both cases the image will load fine but when I'll scroll the table the images will change a few times until the scroll will end and the image will go back to the right…
Segev
  • 19,035
  • 12
  • 80
  • 152
163
votes
12 answers

Custom UITableViewCell from nib in Swift

I'm trying to create a custom table view cell from a nib. I'm referring to this article here. I'm facing two issues. I created a .xib file with a UITableViewCell object dragged on to it. I created a subclass of UITableViewCell and set it as the…
Isuru
  • 30,617
  • 60
  • 187
  • 303
159
votes
22 answers

reloadData() of UITableView with Dynamic cell heights causes jumpy scrolling

I feel like this might be a common issue and was wondering if there was any common solution to it. Basically, my UITableView has dynamic cell heights for every cell. If I am not at the top of the UITableView and I tableView.reloadData(), scrolling…
David
  • 7,028
  • 10
  • 48
  • 95
158
votes
22 answers

How to detect the end of loading of UITableView

I want to change the offset of the table when the load is finished and that offset depends on the number of cells loaded on the table. Is it anyway on the SDK to know when a uitableview loading has finished? I see nothing neither on delegate nor on…
emenegro
  • 6,901
  • 10
  • 45
  • 68
157
votes
12 answers

Changing Font Size For UITableView Section Headers

Can someone please instruct me on the easiest way to change the font size for the text in a UITableView section header? I have the section titles implemented using the following method: - (NSString *)tableView:(UITableView *)tableView…
JRD8
  • 1,595
  • 2
  • 11
  • 6
156
votes
11 answers

Remove the cell highlight color of UITableView

I want to remove the default blue color of uitableview cell selection. I don't want any selection color there. I have not created a custom cell class. I'm customizing the cell by adding labels and buttons over it. I tried doing: cell.selectioncolor…
neha
  • 6,327
  • 12
  • 46
  • 78
154
votes
19 answers

Change Default Scrolling Behavior of UITableView Section Header

I have a UITableView with two sections. It is a simple table view. I am using viewForHeaderInSection to create custom views for these headers. So far, so good. The default scrolling behavior is that when a section is encountered, the section…
davidjhinson
  • 1,695
  • 2
  • 12
  • 6
154
votes
21 answers

UITableViewHeaderFooterView: Unable to change background color

I'm trying to change the background color of UITableViewHeaderFooterView. Although the view is appearing, the background color remains the default color. I'm getting a log from xcode saying: Setting the background color on…
Chun
  • 1,968
  • 3
  • 17
  • 18
151
votes
18 answers

Why does UITableViewCell remain highlighted?

What would cause a table view cell to remain highlighted after being touched? I click the cell and can see it stays highlighted as a detail view is pushed. Once the detail view is popped, the cell is still highlighted.
4thSpace
  • 43,672
  • 97
  • 296
  • 475
149
votes
9 answers

Adding the little arrow to the right side of a cell in an iPhone TableView Cell

This should be simple enough. I have an iPhone app with a TableView. How do I add the little classic arrow to the righthand side of each cell?
Eric Brotto
  • 53,471
  • 32
  • 129
  • 174