Guest User

Untitled

a guest
Jun 13th, 2012
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. UIscrollview resize problem
  2. CGRect scrollframe = scrollView.frame;
  3. NSLog(@"scrollframe.height=%f, pick height=%f",scrollframe.size.height, pick.frame.size.height);
  4. scrollframe.size.height -= pick.frame.size.height;
  5. [UIView beginAnimations:@"start" context:NULL];
  6. [UIView setAnimationDuration:0.2];
  7. [UIView setAnimationBeginsFromCurrentState:YES];
  8. [scrollView setFrame:scrollframe];
  9. NSLog(@"scroll height = %f",scrollframe.size.height);
  10. NSLog(@"scrollview height = %f", scrollView.frame.size.height);
  11. [pick setFrame:CGRectOffset([pick frame], 0, -220)];
  12. [UIView commitAnimations];
  13.  
  14. [scrollframe setContentOffset:CGPointMake(scrollframe.contentOffset.x, scrollframe.contentOffset.y-100)];
  15.  
  16. UIView *contentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
  17. [contentView setBackgroundColor:[UIColor clearColor]];
  18. self.view = contentView;
  19.  
  20. UIScrollView *horizontalScroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
  21. [horizontalScroll setBackgroundColor:[UIColor blackColor]];
  22. [horizontalScroll setDelegate:self];
  23. [contentView addSubview:horizontalScroll];
  24.  
  25. UIPickerView *tempPicker = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 220, 320, 100)];
  26. [tempPicker setHidden:YES];
  27. [contentView addSubview:tempPicker];
Advertisement
Add Comment
Please, Sign In to add comment