PDA

View Full Version : Wrap text in a specific TableView case?




jjgraz
Apr 18, 2009, 08:17 PM
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:@"Courier" size:15.0];
break;
case 1:
cell.text = alabel.date;
cell.font=[UIFont fontWithName:@"Courier" size:15.0];
break;


Thank you.



PhoneyDeveloper
Apr 19, 2009, 09:21 AM
You need to use a multiline label that's added the the cell if you want to wrap the text.