Wednesday, 21 August 2013

Why is my subview is not scrolling?

Why is my subview is not scrolling?

I have a HeadView and after any actions I add a SubView to it:
SubView *sub=[SubView alloc]initWithFrame:CGRectMake(30,30,40,20)];
[self.view addSubview:SubView]; //self is HeadView
After, I add ScrollView to HeadView:
UIScrollView *scroll=[UIScrollView alloc]initWithFrame:self.view.frame];
[scroll setContentSize:CGSizeMake(1000,1000)];
[self.view addSubview:scroll];
and I need, that my subview scrolling. But it's not scrolling. Where is
mistake?

No comments:

Post a Comment