相关疑难解决方法(0)

我们可以在UIPageViewController中自定义页面指示器吗?

现在是黑色背景的白点.如果我想要它是白色背景的黑点呢?

- (NSInteger)presentationCountForPageViewController:(UIPageViewController *)pageViewController NS_AVAILABLE_IOS(6_0)
{
    return _imageArrays.count;
}// The number of items reflected in the page indicator.
- (NSInteger)presentationIndexForPageViewController:(UIPageViewController *)pageViewController NS_AVAILABLE_IOS(6_0)
{
    return self.intCurrentIndex;
}// The selected item reflected in the page indicator.
Run Code Online (Sandbox Code Playgroud)

objective-c ios uipageviewcontroller

43
推荐指数
3
解决办法
5万
查看次数

更改UIPageViewController自己的PageController关于点的颜色

嘿我正在使用UIPageViewController控制我在哪个页面和滚动.我知道只需添加以下两个函数就可以显示页面控制器.

- (NSInteger)presentationCountForPageViewController:(UIPageViewController *)pageViewController

- (NSInteger)presentationIndexForPageViewController:(UIPageViewController *)pageViewController
Run Code Online (Sandbox Code Playgroud)

我想知道的是,是否可以更改页面控制器的颜色,所以在我使用的背景上点更明显?

我知道常规页面控制器具有以下属性:

@property(nonatomic,retain) UIColor *currentPageIndicatorTintColor
@property(nonatomic,retain) UIColor *pageIndicatorTintColor
Run Code Online (Sandbox Code Playgroud)

但是,我无法弄清楚如何从UIPageViewController访问这些属性或页面控制器.

如果有人刚才说如何更改属性,这可能会有所帮助?

xcode properties objective-c uipageviewcontroller

19
推荐指数
2
解决办法
1万
查看次数

动态改变UIPageControl.appearance的点的背景颜色

我有一个UIPagevViewController用于显示 4 ViewControllers。我希望点背景颜色根据我当前使用的视图背景颜色进行更改。虽然我设法为点和第一页获得了相同的背景颜色,但我没有为其他每个页面都这样做。换句话说,我想根据显示的视图动态更改点背景

           import UIKit

            class PageViewController: UIPageViewController,UIPageViewControllerDelegate, UIPageViewControllerDataSource {

            //my 4 viewControllers used in the UIPageViewController
            fileprivate lazy var pages : [UIViewController] = {
                return [
                    self.getViewController(withIdentifier: "firstViewControllerID"),
                    self.getViewController(withIdentifier: "secondViewControllerID"),
                    self.getViewController(withIdentifier: "thirdViewControllerID"),
                    self.getViewController(withIdentifier: "differentViewController")

                ]
            }()

         //function that accesses those view controllers used above from the storyboard
            fileprivate func getViewController(withIdentifier identifier: String) -> UIViewController
                {
                    return UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: identifier)
                }
         /* needed function for the UIPageViewControllerDelegate, UIPageViewControllerDataSource protocols 
        func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: …
Run Code Online (Sandbox Code Playgroud)

uipagecontrol ios swift

4
推荐指数
1
解决办法
995
查看次数

UIPageViewController显示黑条

我有一个UIPageViewController设置来显示UITableViewController内容页面 .功能工作得很好,但桌子隐藏在顶部,底部有一个奇怪的黑色条.

黑条

所以我做的第一件事就是去故事板并更改我的设置,UIPageViewController如下所示.

设置

生成的视图呈现如下:

黑色吧2

理想情况下,我希望寻呼机背景是半透明的,以便您可以看到它下面的表格.此外,虽然表的顶部现在可见,但我不喜欢背景如何变为奇怪的灰色/半透明效果.有关如何修复的任何建议?

ios swift

2
推荐指数
1
解决办法
1798
查看次数