简体   繁体   English

如何将UICollectionView和按钮放在ios中的UIPageControl中?

[英]How to put UICollectionView and button in UIPageControl in ios?

This is my collectionview when i swipe it scrolls, 当我滑动滚动视图时,这就是我的收藏视图 在此处输入图片说明 i have putted UICollectionView and button in UIPageControl, when swipe UICollectionView scrolling, and button view not scrolling smoothly as works as normal UIPageControl 我已经在滑动UICollectionView滚动时将UICollectionView和按钮放在UIPageControl中,并且按钮视图不能像正常的UIPageControl一样平滑滚动 在此处输入图片说明

I'm not sure but I think it has something to do with your CATransitions 我不确定,但我认为这与您的CATransitions

Try changing the last piece of the method so you use UIView animations instead of CATransitions : 尝试更改方法的最后一部分,以便使用UIView动画而不是CATransitions

if(pageControl.currentPage==pageControl.numberOfPages-1)
{
    [UIView animateWithDuration:0.2
                     animations:^{

                         dayRadialCollection.alpha = 0.0f;
                         addWeek.alpha = 1.0f;
                         removeWeek.alpha = 1.0f;

                     } completion:^(BOOL finished) {

                     }];
}
else {

    [UIView animateWithDuration:0.2
                     animations:^{

                         dayRadialCollection.alpha = 1.0f;
                         addWeek.alpha = 0.0f;
                         removeWeek.alpha = 0.0f;

                     } completion:^(BOOL finished) {

                     }];
}

There is also no need to hide the elements, as alpha 0.0f will not show them anyway. 也不需要隐藏元素,因为alpha 0.0f仍然不会显示它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM