views:

15

answers:

1

Hi to all, i am creating a music application in which i am adding a scrollview to uiview.and another view is without scrollview. I want to reduce the size of scrollview from top. When I reduce the size of scrollview it gets reduced from bottom and that is a problem. This is my code for scrollview.

scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0,0,320,360)];
[[self view] addSubview:scroll];
[scroll setScrollEnabled:YES];
[scroll setBounces:NO];
[scroll setAlwaysBounceHorizontal:NO];

First the size of scrollview was 320,400 I reduced it by 40 and made it to 360 and so it get reduced from bottom. I want it should get reduced from top. How it is possible. Please anybody help me regarding this.

+1  A: 

Well, if you reduce the size of the view but you want the bottom to remain at the same coordinate you just need to adapt the y coordinate accordingly as in:

scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0,40,320,360)];
DarkDust
thanks for u r answer
Rani