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
131
votes
15 answers

UIRefreshControl - beginRefreshing not working when UITableViewController is inside UINavigationController

I've setup a UIRefreshControl in my UITableViewController (which is inside a UINavigationController) and it works as expected (i.e. pull down fires the correct event). However, if I programmatically invoke the beginRefreshing instance method on the…
wows
  • 10,687
  • 7
  • 27
  • 27
130
votes
10 answers

Is it possible to obtain a dynamic table view section header height using Auto Layout?

New in iOS 8, you can obtain 100% dynamic table view cells by simply setting the estimated row height, then layout your elements in the cell using Auto Layout. If the content increases in height, the cell will also increase in height. This is…
Jordan H
  • 52,571
  • 37
  • 201
  • 351
130
votes
37 answers

UITableViewCell Separator disappearing in iOS7

I have some strange issue with UITableView only in iOS 7. UITableViewCellSeparator disappears above the first row and below the last row. Sometimes after selecting the rows or some scrolling actions it appears. In my case tableView is loaded from…
B.S.
  • 21,660
  • 14
  • 87
  • 109
129
votes
9 answers

UITableView backgroundColor always gray on iPad

When I set the backgroundColor for my UITableView it works fine on iPhone (device and simulator) but NOT on the iPad simulator. Instead I get a light gray background for any color I set including groupTableViewBackgroundColor. Steps to…
rjobidon
  • 3,055
  • 3
  • 30
  • 36
128
votes
7 answers

How to limit UITableView row reordering to a section

I was hitting my head over this one, and google was turning up nothing. I eventually worked it out and thought I'd write it up here for the sake of the next person. You have a UITableView with multiple sections. Each section is homogeneous, but the…
philsquared
  • 22,403
  • 12
  • 69
  • 98
128
votes
19 answers

Space Between Sections in UITableview

I need to reduce the space between two sections ofUITableView. I looked at this question but the solution doesn't allow for my custom header view because it combines the space of the footer and header. Here is a picture of the UITableView. The…
Joel
  • 1,585
  • 2
  • 10
  • 20
126
votes
8 answers

Default height for section header in UITableView

I want to set the height of the first header in my UITableView. For the other headers I want them to remain the default height. What value/constant can I put in place of "someDefaultHeight" in the code below? - (CGFloat)tableView:(UITableView…
rein
  • 32,967
  • 23
  • 82
  • 106
121
votes
7 answers

UITableview with more than One Custom Cells with Swift

I want to use a UITableview with different custom tableViewCells. My 3 cells are as such: Cell1: should have an image and a label. Cell2: should have two labels. Cell3: should have a dayPicker. I don't want to code a tag for the cells. How…
Easyglider
  • 1,215
  • 2
  • 9
  • 7
121
votes
13 answers

iOS 7 - How to display a date picker in place in a table view?

In WWDC 2013 video, Apple suggests displaying picker in place in a table view in iOS 7. How to insert and animate a view between table view cells? Like this, from the Apple calendar app:
X.Y.
  • 13,726
  • 10
  • 50
  • 63
121
votes
12 answers

UITableViewCell with UITextView height in iOS 7?

How can I calculate the height of an UITableViewCell with an UITextView in it in iOS 7? I found a lot of answers on similar questions, but sizeWithFont: takes part in every solution and this method is deprecated! I know I have to use -…
MyJBMe
  • 2,226
  • 4
  • 15
  • 21
120
votes
12 answers

Weird uitableview behaviour in iOS11. Cells scroll up with navigation push animation

I have recently migrated some code to new iOS 11 beta 5 SDK. I now get a very confusing behaviour from UITableView. The tableview itself is not that fancy. I have custom cells but in most part it is just for their height. When I push my view…
iur
  • 2,056
  • 2
  • 13
  • 30
119
votes
20 answers

How to get the indexpath.row when an element is activated?

I have a tableview with buttons and I want to use the indexpath.row when one of them is tapped. This is what I currently have, but it always is 0 var point = Int() func buttonPressed(sender: AnyObject) { let pointInTable: CGPoint = …
Vincent
  • 1,645
  • 3
  • 14
  • 22
118
votes
15 answers

If no Table View results, display "No Results" on screen

I have a tableview, where sometimes there might not be any results to list, so I would like to put something up that says "no results" if there are no results (either a label or one table view cell?). Is there an easiest way to do this? I would try…
SRMR
  • 3,064
  • 6
  • 31
  • 59
118
votes
17 answers

Expand/collapse section in UITableView in iOS

Could somebody tell me the way to perform UITableView expandable/collapsible animations in sections of UITableView as below? or
vinnitu
  • 4,234
  • 10
  • 41
  • 59
118
votes
16 answers

How to hide first section header in UITableView (grouped style)

As the design of table views using the grouped style changed considerably with iOS 7, I would like to hide (or remove) the first section header. So far I haven't managed to achieve it. Somewhat simplified, my code looks like this: - (CGFloat)…
Codo
  • 75,595
  • 17
  • 168
  • 206