I create a demo for checking UITextView scrollEnabled
.
It only contains 1 UITextView
and 2 button enable and disable scroll
I test on
Yeah you are right disabling and enabling scroll of textview is not working in iOS8 it may be a bug or anything else, let it be. We can disable or enable scroll of text view by just changing the ContentSize of textview .
#import "ViewController.h"
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UITextView *myTextView;
@end
@implementation ViewController
-(IBAction)enableScrollButtonPressed:(id)sender{
CGSize scrollableSize = CGSizeMake(self.myTextView.bounds.size.width+20, self.myTextView.bounds.size.height+20);
[self.myTextView setContentSize:scrollableSize];
}
-(IBAction)disableScrollButtonPressed:(id)sender{
[self.myTextView setContentOffset:CGPointMake(0, 0)];
[self performSelector:@selector(StopScroll) withObject:nil afterDelay:0.1];
}
-(void)StopScroll{
CGSize scrollableSize = CGSizeMake(self.myTextView.bounds.size.width, self.myTextView.bounds.size.height/2);
[self.myTextView setContentSize:scrollableSize];
}
@end
I had tested the above code it is working fine for me i'am using xcode 7.2.1 and iOS 8.3. Give it a try and let me know the result