Search Results

Search found 5 results on 1 pages for 'uitableviewcellstylevalue'.

Page 1/1 | 1 

  • iPhone Device 3.1 SDK Breaks vertical alignment of UITableViewCellStyleValue1 textLabel

    - by user171089
    Can anyone provide an explanation for the following phenomenon? As of the iPhone Device 3.1 SDK, I've found that if a UITableViewCell is of style UITableViewCellStyleValue1 and its detailTextLabel.text is unassigned, then the textLabel does not display in the center of the cell as would be expected. One notable caveat is that this only happens for me when I'm testing on the Device – the iPhone Simulator 3.1 SDK displays the cells correctly. Also, this is not a problem when using the iPhone Device 3.0 SDK. Below is a simple UITableView subclass implementation that demonstrates the problem. @implementation BuggyTableViewController #pragma mark Table view methods // Customize the number of rows in the table view. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 3; } // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease]; } switch (indexPath.row) { case 0: cell.textLabel.text = @"detailTextLabel.text unassigned"; break; case 1: cell.textLabel.text = @"detailTextLabel.text = @\"\""; cell.detailTextLabel.text = @""; break; case 2: cell.textLabel.text = @"detailTextLabel.text = @\"A\""; cell.detailTextLabel.text = @"A"; break; default: break; } return cell; } @end

    Read the article

  • UITableViewCell with UITableViewCellStyleValue1, adding new line to detailTextLabel at cell at botto

    - by slim
    on my tableview i have the last cell that is not initially visible as seen in the first image, when i scroll the list up, you can see in the second image that the price or my detailTextLabel is put on a new line not maintaining the right justification. Here is the code, i can't figure out why its doing this, any direction or help would be much appreciated - (UITableViewCell *)tableView:(UITableView *)ltableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [ltableView dequeueReusableCellWithIdentifier:CellIdentifier]; // Configure the cell. NSUInteger indexRow = [indexPath row]; switch (indexRow) { case 0:{ NSCharacterSet *set = [NSCharacterSet whitespaceCharacterSet]; NSString *description = [[currentData objectForKey:@"Description"] stringByTrimmingCharactersInSet:set]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; } cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.accessoryType = UITableViewCellAccessoryNone; cellShift = 1; if (![description isEqualToString:@""]) { cell.textLabel.text = @""; cell.detailTextLabel.text = description; cell.detailTextLabel.numberOfLines = 2; } else { cell.textLabel.text = @""; cell.detailTextLabel.text = @""; cell.detailTextLabel.numberOfLines = 0; } break; } default:{ if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease]; } NSDictionary *item = [tableData objectAtIndex:(indexRow-cellShift)]; NSString *name = [item objectForKey:@"Name"]; if ([name length] > MaxVendorsLength ) { name = [NSString stringWithFormat:@"%@ ...",[name substringToIndex:MaxVendorsLength]]; } cell.textLabel.text = name; cell.textLabel.minimumFontSize = 12; NSString *priceString; float price = [[item objectForKey:@"Price"] floatValue]; //NSLog(@"| %@ | : | %@ |",[item objectForKey:@"Name"], [item objectForKey:@"Price"]); if (price != 0) { priceString = [[NSString alloc] initWithFormat:@"$%.2f",price]; } else { priceString = [[NSString alloc] initWithString:@"--"]; } cell.detailTextLabel.text = priceString; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; [priceString release]; break; } } cell.textLabel.font = [UIFont boldSystemFontOfSize:15]; cell.textLabel.minimumFontSize = 14; cell.detailTextLabel.font = [UIFont boldSystemFontOfSize:15]; cell.detailTextLabel.minimumFontSize = 14; return cell; } Let me know if i need to post anything else to get help with this ???

    Read the article

  • UITableViewCellStyleValue2 edit indicators?

    - by Jason Jardim
    I am using this style of table view UITableViewCellStyleValue2. I set editing, but I cant seem to get the arrows to show up on the right of the cell - like the Contacts app. Also in the contacts app I notice that if I have a Favorite it puts a * (star) to the right. Any info on how to get an image would be appreciated. Thanks!

    Read the article

  • iphone: custom UITableViewCell taller than the default cell view.

    - by Luc
    Hello, I'm creating an application that consists of a ListView with 5 rows: - 1st one containing a graph - 2nd to 5th rows containing some data with the same formatting. I have created 2 classes: GraphCustomViewCell and DataCustomViewCell. Depending upon the position of the cell I load the correct CustomCell with: NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"GraphCustomViewCell" owner:nil options:nil]; for(id currentObject in topLevelObjects) { if([currentObject isKindOfClass:[GraphCustomViewCell class]]) { cell = (GraphCustomViewCell *)currentObject; break; } } That works fine except that the first row, the one corresponding to the graph, is bigger (in height) that the 4 other rows, and as a results it hides the 3 first other rows. Is there any option in the table view that enables the custom cell to expand the default cells ? I'd like that the 5 rows (graph + 4 data rows) to fit the entire screen (480 - tabbar's height). Thanks a lot for your help. Regards, Luc

    Read the article

  • How to avoid truncation of text with UITableViewCellStyleValue2

    - by Regan
    I use this code to make my UITableViewCells cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:CellIdentifier] autorelease]; If you're unfamiliar with UITableViewCellStyleValue2, the main text is shown, and then the detail text is shown after it, generally in a different color. However, when I do this, my main text is truncated, if it is longer than a short word. I want to force it to not truncate the main text and show the entire main text, and then the detail text after it. How can I do that?

    Read the article

1