Skip to main content

Posts

Showing posts with the label uitableviewcell

How to stop UITextView from scrolling up when entering it

I have a UITextView included in a UITableViewCell . The layout is correct when the views are initially displayed, but once I click in the UITextView it automatically scrolls up a bit and the top half of the characters on the first line becomes invisible.

Long press on UITableView

I would like to handle a long press on a UITableViewCell to print a "quick access menu". Does someone already did this ? Particularly the gesture recognize on UITableView ? Source: Tips4all

UITableView…the correct way

I'm trying to make a UITableView like the native calendar app: but I'm trying to learn the best way to do this. I'm able to get this for the most part with a switch statement in the cellForRowAtIndexPath method, but I'm having troubles changing the textColor when a cell is selected. For some reason cell.isSelected is always NO, and I have no way to reload the tableview after another cell is selected anyway. Should I subclass UITableViewCell for something this simple and store an array of cells? Any help would be appreciated, thanks.

Delete UITableViewCell and ALL of that cell"s data

I have a UITableViewCell. I can add and subtract 1 from the cell's textLabel and I can also delete the cells. Here is my problem, Lets say i add 5 to the value of the textLabel . And this cell is at the 0 indexPath (The First cell in the table). When I delete this cell and there are now no longer any cells on the table, I add a new cell and this new cell automatically gets the same value as the cell that was just deleted. SO this new cell will have a value of 5 and i want the cell to have a value of 1 just like every cell should when it is added. This only happens when a cell is deleted and a new cell is added at that exact same indexPath. So my question is: do i have to delete this cells "memory" or "data" for this to be fixed? Thanks a bunch for the help! CellForRowAtIndexPath : - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; cell = [