我有个问题。我想向用户显示一些内容UIScrollView
。我想从下到autoscroll
上UIScrollView
快速(就像在苹果商店里一样iPad
)。我尝试使用DDAutoscrollview
(如果有人知道),但它对我不起作用。有人为我解决问题autoscroll
吗UIScrollView
?任何代码片段都会很好。
。H
@interface Interface1 : UIViewController {
IBOutlet UIScrollView *scroller;
IBOutlet UILabel *warnung;
}
@property (nonatomic, retain) IBOutlet UIScrollView* scrollView;
.m
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
CGPoint bottomOffset = CGPointMake(self.scrollView.contentOffset.x,
self.scrollView.contentSize.height -
self.scrollView.bounds.size.height);
[self.scrollView setContentOffset:bottomOffset animated:NO];
CGPoint newOffset = self.scrollView.contentOffset;
newOffset.y = 0;
[self.scrollView setContentOffset:newOffset animated:YES];
}
- (void)viewDidLoad {
[scroller setScrollEnabled:YES];
[scroller setContentSize:CGSizeMake(320, 420)];
[super viewDidLoad];
}
谢谢。