Questions tagged [tableview]

A table view is a means for displaying and editing hierarchical lists of information. For example: UITableView in Cocoa Touch.

7929 questions
134
votes
13 answers

How to remove extra empty cells in TableViewController, iOS - Swift

Hi I have a TableViewController with two static cells, however when displayed, it shows the two static cells, and then all the other empty cells for the tableview. However I don't want to display those cells as they are useless. How do I hide the…
Stephen Fox
  • 14,190
  • 19
  • 48
  • 52
120
votes
10 answers

SplitView like Facebook app on iPhone

I want to create an iPhone app that uses a navigation scene similar to the one pictured in the link Please note I do not want this to only work for iPad, I want it to work for iPhone exactly as pictured, when you click on a tableview item it hides…
105
votes
21 answers

How to get UITableView from UITableViewCell?

I have a UITableViewCell which is linked to an object and I need to tell if the cell is visible. From the research I've done, this means I need to somehow access the UITableView that contains it (from there, there are several ways to check if it's…
sinθ
  • 11,093
  • 25
  • 85
  • 121
94
votes
11 answers

How to change height of grouped UITableView header?

I know how to change the height of the section headers in the table view. But I am unable to find any solution to change the default spacing before the first section. Right now I have this code: - (CGFloat)tableView:(UITableView *)tableView…
circuitlego
  • 3,469
  • 5
  • 22
  • 22
81
votes
8 answers

UITableView: hide header from empty section

i have a UITableView, that displays expenses from a current month (see screenshot): My problem is with the header for empty sections. is there any way to hide them? The data is loaded from coredata. this is the code that generates the header…
Sebastian Flückiger
  • 5,525
  • 8
  • 33
  • 69
69
votes
7 answers

Detect doubleclick on row of TableView JavaFX

I need to detect double clicks on a row of a TableView. How can I listen for double clicks on any part of the row and get all data of this row to print it to the console?
Marcos
  • 4,827
  • 3
  • 20
  • 28
69
votes
26 answers

JavaFX 2.1 TableView refresh items

I have this common issue, as it appears to be. My table view wont refresh my items after I reset them. I have checked the data and it's the new one. I tried multiple solution from internet but no success. Can't reset all the columns because it…
user1236048
  • 5,542
  • 7
  • 50
  • 87
68
votes
7 answers

Set collectionView size. (sizeForItemAtIndexPath function is not working) Swift 3

I have a tableView and in every tableViewCell is a collectionView. I am trying to change the collectionView size with this code: func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout:…
0ndre_
  • 3,577
  • 6
  • 26
  • 44
60
votes
9 answers

Scroll to top of UITableView by tapping status bar

I know there's tons of code out there to scroll a tableview to the top, but I want to do this when the top status bar is tapped, just like in Apple's native apps. Is this possible?
iOSDev
  • 1,028
  • 4
  • 13
  • 21
59
votes
30 answers

Changing background color of selected cell?

Does anyone know how to change the background color of a cell using UITableViewCell, for each selected cell? I created this UITableViewCell inside the code for TableView.
sg.
  • 637
  • 1
  • 6
  • 5
53
votes
6 answers

JavaFX TableView text alignment

As you can see on the picture the text alignment for each colum is set to left alignment. Is there any way to change this? So far I've tried within my CSS file: #Cols{ text-align: right; } I have also tried: #Cols{ -fx-text-alignment:…
Marc Rasmussen
  • 19,771
  • 79
  • 203
  • 364
49
votes
7 answers

Is force cast really bad and should always avoid it?

I started to use swiftLint and noticed one of the best practices for Swift is to avoid force cast. However I used it a lot when handling tableView, collectionView for cells : let cell = collectionView.dequeueReusableCellWithReuseIdentifier(cellID,…
44
votes
5 answers

JavaFX8: How to create listener for selection of row in Tableview?

I currently have two tableviews in one screen, which results in both TableViews have rows which the user can select. Now I want only one row to be selected at the same time (doesn't matter which TableView it is selected from). I was thinking about…
bashoogzaad
  • 4,611
  • 8
  • 40
  • 65
41
votes
8 answers

How to get textLabel of selected row in swift?

So i am trying to get the value of the textLabel of the row I select. I tried printing it, but it didn't work. After some research I found out that this code worked, but only in Objective-C; - (void)tableView:(UITableView *)tableView…
Jonathan Neeskens
  • 551
  • 1
  • 4
  • 12
39
votes
14 answers

How to get a UITableview to go to the top of page on reload?

I am trying to get a UITableview to go to the top of the page when I reload the table data when I call the following from - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { // A bunch…
AppsToKnow
  • 405
  • 1
  • 4
  • 4
1
2 3
99 100