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
1609
votes
29 answers

Using Auto Layout in UITableView for dynamic cell layouts & variable row heights

How do you use Auto Layout within UITableViewCells in a table view to let each cell's content and subviews determine the row height (itself/automatically), while maintaining smooth scrolling performance?
smileyborg
  • 30,197
  • 11
  • 60
  • 73
1274
votes
42 answers

How can I disable the UITableView selection?

When you tap a row in a UITableView, the row is highlighted and selected. Is it possible to disable this so tapping a row does nothing?
davidmytton
  • 38,604
  • 37
  • 87
  • 93
771
votes
34 answers

Eliminate extra separators below UITableView

When I set up a table view with 4 rows, there are still extra separators lines (or extra blank cells) below the filled rows. How would I remove these cells?
RoundOutTooSoon
  • 9,821
  • 8
  • 35
  • 52
724
votes
78 answers

Why is there extra padding at the top of my UITableView with style UITableViewStyleGrouped in iOS7

Starting in iOS7, there is additional space at the top of my UITableView's which have a style UITableViewStyleGrouped. Here is an example: The tableview starts at the first arrow, there are 35 pixels of unexplained padding, then the green header is…
esilver
  • 27,713
  • 23
  • 122
  • 168
684
votes
43 answers

iOS 8 UITableView separator inset 0 not working

I have an app where the UITableView's separator inset is set to custom values - Right 0, Left 0. This works perfectly in iOS 7.x, however in iOS 8.0 I see that the separator inset is set to the default of 15 on the right. Even though in the xib…
user3570727
  • 10,163
  • 5
  • 18
  • 24
581
votes
19 answers

UITableViewCell, show delete button on swipe

How do I get the delete button to show when swiping on a UITableViewCell? The event is never raised and the delete button never appears.
TheLearner
  • 19,387
  • 35
  • 95
  • 163
418
votes
37 answers

UITableView - scroll to the top

In my table view I have to scroll to the top. But I cannot guarantee that the first object is going to be section 0, row 0. May be that my table view will start from section number 5. So I get an exception, when I call: [mainTableView…
Ilya Suzdalnitski
  • 52,598
  • 51
  • 134
  • 168
406
votes
21 answers

Can you animate a height change on a UITableViewCell when selected?

I'm using a UITableView in my iPhone app, and I have a list of people that belong to a group. I would like it so that when the user clicks on a particular person (thus selecting the cell), the cell grows in height to display several UI controls for…
Ted
371
votes
10 answers

How to remove empty cells in UITableView?

i am trying to display a simple UITableView with some data. I wish to set the static height of the UITableView so that it doesn't displays empty cells at the end of the table. how do I do that? code: - (NSInteger)tableView:(UITableView *)tableView…
z22
  • 10,013
  • 17
  • 70
  • 126
360
votes
10 answers

How to pass prepareForSegue: an object

I have many annotations in a mapview (with rightCalloutAccessory buttons). The button will perform a segue from this mapview to a tableview. I want to pass the tableview a different object (that holds data) depending on which callout button was…
chizzle
  • 4,142
  • 5
  • 18
  • 18
357
votes
16 answers

UITableView didSelectRowAtIndexPath: not being called on first tap

I'm having an issue with UITableView's didSelectRowAtIndexPath. My table is setup so that when I select row it initializes a new view controller and pushes it. The first time I tap any row in the table, the method does not get called. Once I select…
Mark Adams
  • 30,776
  • 11
  • 77
  • 77
351
votes
34 answers

UITableView - change section header color

How can I change color of a section header in UITableView? EDIT: The answer provided by DJ-S should be considered for iOS 6 and above. The accepted answer is out of date.
Ilya Suzdalnitski
  • 52,598
  • 51
  • 134
  • 168
343
votes
34 answers

UITableView Cell selected Color?

I have created a custom UITableViewCell. The table view is showing data fine. What I am stuck in is when user touches cell of tableview, then I want to show the background color of the cell other than the default [blue color] values for highlighting…
Mc.Lover
  • 4,813
  • 9
  • 46
  • 80
326
votes
22 answers

Assertion failure in dequeueReusableCellWithIdentifier:forIndexPath:

So I was making an rss reader for my school and finished the code. I ran the test and it gave me that error. Here is the code it's referring to: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath…
Nick Scottman
  • 3,289
  • 2
  • 14
  • 8
317
votes
23 answers

UITableview: How to Disable Selection for Some Rows but Not Others

I am displaying in a group tableview contents parsed from XML. I want to disable the click event on it (I should not be able to click it at all) The table contains two groups. I want to disable selection for the first group only but not the second…
Warrior
  • 39,156
  • 44
  • 139
  • 214
1
2 3
99 100