Reputation: 11231
I have created a UITextView programatically and want to enable scrolling for that UITextView.
Is there any property or method to do that becoz its not enabled by default. I am using the following code which displays it but its not scrolling down.
UITextView* txt_tipView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, 165, 60)];
txt_tipView.backgroundColor = [UIColor clearColor];
txt_tipView.textColor = [UIColor colorWithRed:(51/255) green:(51/255) blue:(51/255) alpha:1];
txt_tipView.font = [UIFont fontWithName:@"Helvetica" size:12];//[UIFont boldSystemFontOfSize:12];
txt_tipView.editable = FALSE;
txt_tipView.frame = CGRectMake(138, 96, 165, 60);
[self.view addSubview:txt_tipView];
Upvotes: 2
Views: 5692
Reputation: 31280
UITextView inherits from UIScrollView (you can see that in the Inspector tab in Interface Builder, or through the documentation). That means that any property of UIScrollView can also be set on UITextView:
txt_tipView.scrollEnabled = YES;
Upvotes: 5