uitableviewcell

Is hard-coded subview sizing brittle or best practice?

Coming from a web background, where explicit sizing is generally not considered best practice, I am not used to 'hardcoding' positioning values. For example, is it perfectly acceptable to create custom UITableViewCells with hardcoded values for subviews' frames and bounds? It seems that when the user rotates the device, I'd need another...

UITableViewCells to be in center of UITableView

Hi, I want that my 4 cells will be in the center of my UITableView. Can't scroll the UITableView. That there will be the same height above the first cell and below the last cell. thanks ...

Set row height from the height of an image loaded from a plist.

I have a UITableView that displays single large images in each cell. The names of the images are stored in a plist. I would like to adjust the hight of each cell to accommodate the height of the image. Does anyone know of a way to get the height for an image and use it to set the row height? I'm having trouble finding this one and rea...

How are touches handled by a UITableView?

I'm trying to better understand how UITableView and UITableViewCell work, and one part of that is touch handling. So when I touch a row on a table view, what exactly happens? My basic understanding is: UITableView is a UIScrollView, so first it checks if it's a touch or a scroll If it's not a scroll then the touch gets analyzed to see...

Adjusting the positions of the labels in a UITableViewCell

I'm using a UITableViewCell with UITableViewCellStyleSubtitle. However, because of the background image I'm using for the cell, I don't like where the detailTextLabel is going. I want to move it and resize it within the cell, but nothing I try seems to work. CGRect currRect = cell.detailTextLabel.frame; cell.detailTextLabel.frame = CGRe...

NSString is cut off prematurely in a UITableViewCell in 3.0, but looks fine in 3.1

I am using UITableViewCellStyleValue2 and UITableViewStyleGrouped. Let's start with some code (it's not 100% complete, but I have tried to include the code needed to hopefully decipher what I am doing, and maybe doing wrong): #define CELL_FONTSIZE 15.0f CGSize textSizeValue2 = {207.0f, 9999.0f}; if ([value isEqual: CELL_4]) { CGS...

Increase size of tappable area for UITableViewCellAccessoryDetailDisclosureButton

Hi, How to increase the size of tappable area in a UITableViewCell with a UITableViewCellAccessoryDetailDisclosureButton type accessory ? The Apple default is way to small and make hard the tapping of this button... Thanks ...

Updating alternating colored UITableViewCells when rows gets reordered or deleted

I'm having a UITableView with alternating colored UITableViewCells. And the table can be edited: rows can be reordered and deleted. How do I update the cells alternating background color, when the rows get reordered or deleted? I'm using this to draw the alternating colored cells: - (void)tableView:(UITableView *)tableView willDisplayC...

How do i set a nested property if the object needs to be cast?

In my method to set labels in my cells (for a UITableView) I'm reading in 'id' thats actually a UITableViewCell since I'm reading in several different types of cells. ie. -(void)setMyCell:(id)cell atIndexPath:(NSIndexPath*)indexPath; Some of the cells are the generic UITableViewCellStyle type while others are more complicated and load...

UISwitch inside custom UITableViewCell not available

I have a UISwitch inside a custom UITableViewCell (the subclass of which I call RootLabeledSwitchTableCell). The cell contains a UILabel and UISwitch next to each other. I have a @property called keychainSwitch that points to the switch inside this custom cell: @interface RootLabeledSwitchTableCell : UITableViewCell { IBOutlet UIL...

How do I select a UITableViewCell by default?

I have created a UITableView and would like a specific UITableViewCell to appear selected (blue) when the view is loaded. ...

Custom Cell from nib leaking

I have a subclass of UITableViewCell and am trying to use it. At the moment it does display fine as a test but I get leaking errors to the console... - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CustomCellIdentifier = @"CustomCellIdentifier "; ...

duplicate rows in tableview on uitableviewcell

I have found some posts which are similar to my issue but not quite the same. In my app the user can navigate between several uitableviews to drill down to the desired result. When a user goes forward, then backward, then forward, etc it is noticeable that the rows are being redrawn/re-written and the text gets bolder and bolder. I ...

How to add gradient at bottom of UITableViewCell as Tweetie app does

Does anybody know how: add small gradient to bottom of each UITableViewCell to visually highlight separation between cells and at the same time make each second cell in table a bit darker then the each first row. A great example of that stuff is Tweetie app. When you tap on your twitter account name you'll see table view with twitts....

UITableViewCell frame has NaN value

I have a custom UITableViewCell that I created in IB. To populate a UITableView with instances of these cells, loaded from a NIB, I use the following code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"overviewCell"; HOStoreOverviewC...

UITableViewCell rounded corners and clip subviews

I can't find anything anywhere(search engines, docs, here, etc) that shows how to create rounded corners (esp. in a grouped table view) on an element that also clips the subviews. I have code that properly creates a rounded rectangle out of a path with 4 arcs(the rounded corners) that has been tested in the drawRect: method in my subcla...

Mysterious UITableView stuck problem

Hi, I'm new to iPhone development. I'm working on a table view (default UITableView subclass) that contains complicated custom cells, with multiple subviews and controls. Scrolling is not very smooth, but I'll just leave that for now. The question is, when I'm scrolling the table view with quick swipes, the table sometimes suddenly stop...

Format and draw text in UITableViewCell ala Twitterrific for iPhone

I would like to have formatted, clickable text and images inside a selected UITableViewCell. An example of the functionality I'm looking for can be seen in the iPhone Twitterrific app. When the user clicks on a cell, the cell is highlighted and the various links become highlighted and clickable. I've seen the idea of using a UIWebView i...

Strange UIImage positioning problem

I created a view in Interface Builder with a bunch of labels and an image. When I pushed the view onto a UINavigationController, it worked perfectly. I then inserted the view into a UITableView as a cell (instead); in order to do so, I had to convert change the superclass of its view controller from a UIViewController to a UITableViewC...

Is it possible to preload all tableview cells to enable smooth scrolling?

I have a tableview that only holds a few (~5)cells with a large image in each cell. Is it possible to preload all the cells to improvescrolling performance? Right now, there is a slight jerk when each cell is loaded. Thanks! ...