I am going to add a UIScrollView into a UIView programmatically. I tried to use the following code for this but the scrollview is still not disabled.
-(id)initWithFrame:(CGRect)frame {
...
_scrollView = [[UIScrollView alloc] initWithFrame:CGRectZero];
[self addSubview:_scrollView];
...
}
-(void)layoutSubviews {
...
_scrollView.frame = CGRectMake(0, 0, self.frame.size.width, 40);
[_scrollView setContentSize:CGSizeMake(self.frame.size.width * 2, 40)];
...
}
I think it should work but it's not working now. Please advise me what the problem is. Thanks