views:

313

answers:

1

Hey Simple little app for educational purposes, its a simple uitableview and I want users to be able to use a uislider to adjust the font size as needed. The code I have now works to change the font but only when the view is updated, ie when i pull up or down the table view to reveal other cells. I'd like the font change to be reflected immediately as a user moves the uislider if possible, here's the code that I have working half way:

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

  static NSString *SimpleTableIdentifier = @"SimpleTableIdentifier";

   UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:   SimpleTableIdentifier];

   if (cell == nil) 
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:       SimpleTableIdentifier] autorelease];

   NSUInteger row = [indexPath row];
   cell.text = [listData objectAtIndex:row];
   UIImage *image = [UIImage imageNamed:@"star.png"];
   cell.font = [UIFont systemFontOfSize:[fontSlider value]];

   cell.image = image;
   return cell;


  }
A: 

You could make an IBAction for the fontSlider for the "Value Changed" option as follows:

-(IBAction) refreshResize
{
[self.view setNeedsDisplay];
}

That should work. setNeedsDisplay refreshes the screen.

thyrgle
sounds like it would work i havent touched this project in a while but I do appreciate the response.
nickthedude