从UIPageViewController隐藏点 [英] Hide dots from UIPageViewController

查看:239
本文介绍了从UIPageViewController隐藏点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做一个很简单的事情。只需删除所有的点和UIPageViewController底部的栏。

I would like to do to a pretty simple thing. Just remove all the dots, and the bar on the bottom of the UIPageViewController.

这是设置:我有一个自定义视图控制器有UIPageViewController * pageController $ b $我显示它像这样:

This is the setup: I have a custom view controller which has UIPageViewController *pageController I display it like this:

self.pageController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil];

self.pageController.dataSource = self;
[[self.pageController view] setFrame:[self.view bounds]];

BSItemPageViewController *initialViewController = [self viewControllerAtIndex:selectedIndex];

NSArray *viewControllers = [NSArray arrayWithObject:initialViewController];

[self.pageController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];

[self addChildViewController:self.pageController];
[[self view] addSubview:[self.pageController view]];
[self.pageController didMoveToParentViewController:self];

有关如何删除这些点的任何想法?

Any ideas on how do I remove the dots?

推荐答案

仅当数据源实现这些方法时才显示页面控件:

The page control is only displayed if the datasource implements these methods:

presentationCountForPageViewController:
presentationIndexForPageViewController:

只要删除这些实现,不显示。从数据源文档

Simply remove your implementation of these, and the page control will not be displayed. From the datasource docs:


如果支持页面指示符中的两个方法都实现,并且页面视图控制器的转换风格是UIPageViewControllerTransitionStyleScroll,则页面指示符是可见的。

If both of the methods in "Supporting a Page Indicator" are implemented and the page view controller’s transition style is UIPageViewControllerTransitionStyleScroll, a page indicator is visible.

这篇关于从UIPageViewController隐藏点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆