我添加了UIScrollView
并启用了分页功能。在阿拉伯国家,通常刷卡是从右到左。
这可以用UIScrollView
吗?
答案 0 :(得分:0)
假设您有一个想要滚动视图的contentView。这是我将使用的方法。将scrollView的contentSize设置为contentView具有的任何大小。将contentView添加到视图中。设置在scrollView的偏移量上,如果支持2个屏幕大小,则视图之间应该有158的差异。
if([UIScreen mainScreen].bounds.size.height == 568.0)
{
UIScrollView *scrollView=(UIScrollView *)self.view;
scrollView.contentSize=self.contentView.frame.size;
[self.view addSubview:self.contentView];
[scrollView setContentOffset:CGPointMake(286, 0.0f)];//Put the offset here so it swipes right to left. For iPhone 5/5s
self.title = @"the ContentView";
}
else{
UIScrollView *scrollView=(UIScrollView *)self.view;
scrollView.contentSize=self.contentView.frame.size;
[self.view addSubview:self.contentView];
[scrollView setContentOffset:CGPointMake(444, 0.0f)]; //Put the offset here so it swipes right to left. For iPhone 3gs/4/4s
self.title = @"The ContentView";
}