Skip to content

Instantly share code, notes, and snippets.

@keicoder
Last active December 31, 2015 17:09
Show Gist options
  • Save keicoder/8018610 to your computer and use it in GitHub Desktop.
Save keicoder/8018610 to your computer and use it in GitHub Desktop.
objective-c : UITextView 기본 세팅 : ViewDidLoad 메소드
- (void)viewDidLoad
{
[super viewDidLoad];
[[self.textView layer] setCornerRadius:10]; //텍스트 뷰 코너 곡선 적용
self.textView.textContainer.lineFragmentPadding = 20; //노트필드 패딩 (iOS 7)
//텍스트 뷰 인셋
//[self.textView setTextContainerInset:UIEdgeInsetsMake(20, 20, 20, 20)]; //iOS 7
//[self.textView setContentInset:UIEdgeInsetsMake(0, 10, 0, 0)]; //iOS 6
self.textView.userInteractionEnabled = YES; //텍스트 뷰 유저 인터렉션
self.textView.alwaysBounceVertical = YES; //텍스트 뷰 바운스
self.textView.keyboardDismissMode = UIScrollViewKeyboardDismissModeInteractive; //텍스트 뷰 키보드 dismiss mode
self.textView.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; //텍스트 뷰 텍스트 폰트
[self.textView setBackgroundColor:[UIColor colorWithHexString:@"#D6D6D6"]]; //텍스트 뷰 백그라운드 컬러
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment