小编Dan*_*her的帖子

带有PageControl的UIPageViewController

我正在使用UIPageViewController来显示其他4个ViewControllers.所以我的RootViewController是一个PageViewController,它显示我在Storyboard中创建的4个其他ViewControllers,其中包含不同视图的segues.一切都很完美.但是可以向此PageViewController添加UIPageControl.无论如何这可能吗?

或者有人知道如何才能取得类似的结果?

太棒了,谢谢!

iphone xcode ios pagecontrol ios6

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

UICollectionView 单元格在为 collectionView 位置设置动画后短暂闪烁/闪烁

我有一个 UICollectionView,它固定到顶部布局指南(我使用 NavigationController 因此它固定到导航栏)并与它覆盖的图像底部对齐。

我隐藏了导航栏并为图像位置设置了动画,这意味着由于限制,CollectionView 也在移动。

在我的 scrollView 的 scrollViewDidScroll 委托方法中,我正在为它们设置动画:

if scrollView.panGestureRecognizer.translation(in: scrollView).y > 0 {
            //scrolling up
            navigationController?.setNavigationBarHidden(false, animated: true)
            UIView.animate(withDuration: 0.2, animations: {
                self.topImageContraintToTop.constant = 0
                self.view.layoutIfNeeded()
            })
        } else {
            //scrolling down
            navigationController?.setNavigationBarHidden(true, animated: true)
            UIView.animate(withDuration: 0.2, animations: {
                self.topImageContraintToTop.constant = -(self.navigationController?.navigationBar.bounds.size.height)! - 10
                self.view.layoutIfNeeded()
            })
        }
Run Code Online (Sandbox Code Playgroud)

因此,每次发生此动画时,CollectionView 的可见单元格都会短暂闪烁/闪烁。

我已经搜索了几个小时来解决,但到目前为止没有任何帮助。

对于这个问题,我很感激任何一种方法。

xcode animation collectionview ios swift

6
推荐指数
0
解决办法
1058
查看次数

UIPageControl setCurrentPage - UICollectionView iOS6

我是XCode的新手,所以我需要你的帮助.我使用UIPageControl来显示我的集合View中的哪个单元格现在可见.

问题是得到可见的细胞:

我想在这个方法中

-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
Run Code Online (Sandbox Code Playgroud)

我应该更新当前页面.但是如何获得当前的页面?

谢谢你的帮助!:-)

iphone xcode scrollview pagecontrol ios6

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

标签 统计

xcode ×3

ios ×2

ios6 ×2

iphone ×2

pagecontrol ×2

animation ×1

collectionview ×1

scrollview ×1

swift ×1