2012-11-13 2 views

답변

1

확대/축소 UITextView에서 UITextView 대리인의 글꼴 크기를 늘릴 수있는 경우에는 아무런 의미가 없습니다.

UITextView *textView = [UITextView alloc] initWithFrame:CGRectMake(0, 0, 320, 200)]; 
UIPinchGestureRecognizer *gestureRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(changeFontSize:)]; 
[textView addGestureRecognizer:gestureRecognizer]; 

- (void)changeFontSize:(UIPinchGestureRecognizer *)gestureRecognizer { 
    UITextView *textView = (UITextView *)gestureRecognizer.view; 
    float yourFontSize = gestureRecognizer.scale * FONT_SIZE; 
    textView.font = [UIFont systemFontOfSize:yourFontSize]; 
} 
관련 문제