Wrap text in a specific TableView case?

Discussion in 'iOS Programming' started by jjgraz, Apr 18, 2009.

  1. macrumors regular

    jjgraz

    Joined:
    Feb 13, 2009
    #1
    I have a tableView with attached Detail page. In the detail page is a Indexed TableView. One of the items(cases) requires a text wrap....Is there a way to Wrap text in a specific TableView case? See Code Below. Any help would be greatly appreciated. Thank you.

    - (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
    }

    switch(indexPath.section)

    {
    case 0:
    cell.text = alabel.name;
    cell.font=[UIFont fontWithName:mad:"Courier" size:15.0];
    break;
    case 1:
    cell.text = alabel.date;
    cell.font=[UIFont fontWithName:mad:"Courier" size:15.0];
    break;


    Thank you.
     
  2. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    You need to use a multiline label that's added the the cell if you want to wrap the text.
     

Share This Page