2010-02-02 7 views
1

안녕하세요 간단한 교육용 응용 프로그램으로, 간단한 uitableview와 사용자가 uislider를 사용하여 필요에 따라 글꼴 크기를 조정할 수 있기를 바랍니다. 이제는 글꼴이 변경되지만 뷰가 업데이트 될 때만 코드가 작동합니다. 즉 테이블 뷰를 위로 또는 아래로 당겨 다른 셀을 표시 할 때입니다. 당신은 변경 "값의 fontSlider에 대한 IBAction를 만들 수UITableView에서 글꼴 크기 변경 애니메이션하기

-(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; 


    } 

답변

0

: 가능하면 사용자가 uislider를 이동할 때 나는 여기에 내가 절반 방법을 작업 한 코드의 즉시 반영 할 수있는 글꼴 변경을하고 싶습니다 "옵션은 다음과 같습니다.

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

그래야합니다. setNeedsDisplay는 화면을 새로 고칩니다.

+0

나는이 프로젝트를 잠시 동안 만지면 안 될 것 같지만 응답에 감사드립니다. – nickthedude