I am working on creating a table where each cell has a play button and a MPMoviePlayerController. It is setup so that I have custom UITableViewCell class that loads a .xib. Just to make sure the cells are being reused correctly, I have the tableView Controller set a number for the button title (whatever the indexpath.row is). This displays correctly, but when I play one of the cell's videos and scroll down quickly it appears again in another cell. How can I resolve this?
Related
I have created a custom UICollectionViewCell which contains UILabels, UIButtons and UITextFields. The custom cell is successfully loaded and appears properly on the device screen but the problem is I cant seem to intercept any touch events on the elements of the custom cell in the collection view.
What could be the problem?
I am using a UISearchController in my application following this tutorial:
Now having set up a custom UITableViewCell. The UISearchController messes with my cells.
It seems like the UISearchController is not using the same custom UITableViewCell and it's view bounds differ from my own UITableView. Is there a way to change this back, when I press the cancel button?
Edit:
Though, nobody has answered, I found a solution:
make sure, your cell is connected to the actual tableView, not your primary only. ( I have used an Outlet and set only the cells of my outlet )
make sure you ALWAYS address the outlets in your custom cell. Since I used this
cell.textLabel?.text = "Hello"
my cell will automatically be cast to the default cell.
I have a tableview with a number of custom cells. The problem I am having is that the cell with the pickerview is 'bleeding' behind the neighboring cell.
Once I push another view controller and pop back, the neighboring cell is properly opaque until I manipulate the picker, at which point the issue materializes again.
The cell is, in fact, opaque. I have set it as such in both the storyboard and code. I have also tried setNeedsLayout and layoutIfNeeded in cellForRowAtIndexPath.
Set clipsToBounds property to true to each cell in the method cellForRowAtIndexPath.
You can set this property in the Storyboard if you are using prototypes cells.
You need to provide more information.
But if I understand correctly, you should hide the cell that contains the picker and only show it when the user will input.
Here is a tutorial on how to hide the cell, like the calendar iOS app does.
http://www.appcoda.com/expandable-table-view/
Here is how the tableViewCell appears within the TableVIew in the storyboard. The Cell is a custom made cell in the interface builder.
Here is how the same TableView appears live.
Im wondering what is causing the lives Cell white background to be truncated and turned grey. I would like the entire Cell to look the same as it does in the Storyboard.
For reference, this tutorial I am following: http://mobile.tutsplus.com/tutorials/iphone/customizing-uitableview-cell/
I have to create a custom UITableViewCell, and from the tutorial, it said to leverage Prototyping cells and subclass UITableViewCell. Then connect the UI elements in the prototype cel to the custom class (of UITableViewCell).
The problem I am running into here is, there is only one cell for the whole table view that is displaying data. However, I am able to click on empty cells in the background behind that one cell that contains data. If i scroll up or down, cellForRowAtIndexPath is called and another cell gets displayed. However its only displaying once cell at a time for the whole table view.
Does anyone know what the problem could be here? Any help is appreciated, thanks!
Figured out what the problem is, my labels (that are supposed to be inside the custom prototyping cell) were added to the parent view and not the content view of UITableViewCell. This is because my prototype cell did not have a content view for some reason. I had to add a another prototype cell and delete the previous one.
reference: How to add subviews to a custom UITableViewCell in a storyboard