ユーザーがストーリー/コンテンツである1つのビューを見ているときに左/右にスワイプして、次のコンテンツ(x of yページ)に戻るまたは進むような方法を知りたいです。
CNN iOSアプリのように、ユーザーが現在どこを見ているかを示す小さな円が並んでいます。
Xcodeのスワイプジェスチャレコグナイザーがそれを実現する主な要因ですか?
ユーザーがストーリー/コンテンツである1つのビューを見ているときに左/右にスワイプして、次のコンテンツ(x of yページ)に戻るまたは進むような方法を知りたいです。
CNN iOSアプリのように、ユーザーが現在どこを見ているかを示す小さな円が並んでいます。
Xcodeのスワイプジェスチャレコグナイザーがそれを実現する主な要因ですか?
この ui 要素はUIPageControlと呼ばれます
-(void)scrollView
{
scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0,0,320,460)];
scrollView.backgroundColor = [UIColor clearColor];
scrollView.pagingEnabled = YES;
[scrollView setScrollsToTop:YES];
scrollView.showsVerticalScrollIndicator=NO;
scrollView.showsHorizontalScrollIndicator=NO;
scrollView.contentSize = CGSizeMake(320*totalPages,460);
scrollView.delegate = self;
[self.view addSubview:scrollView];
}
-(void)makePages
{
for (int i=0; i<totalPages; i++)
{
containerView = [[UIView alloc]initWithFrame:CGRectMake(320*i,0,320,460)];
containerView.backgroundColor = [UIColor clearColor];
containerView.tag = i;
if(i%2 == 0)
containerView.backGroundColor = [UIColor blueColor];
else
containerView.backGroundColor = [UIColor blueColor];
[scrollView addSubview:containerView];
}
[scrollView scrollRectToVisible:CGRectMake(0,0,320,460) animated:YES];
}