Closed. This question needs to be more focused。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗?更新问题,使其仅通过editing this post专注于一个问题。
                        
                        4年前关闭。
                                                                                            
                
        
我喜欢在iOS中添加带有可滚动自定义视图控制器的可滚动标签栏,例如Google Play商店。android play store screen

谢谢...

最佳答案

第三方

如果您想继续使用ThirdParty,请使用MXSegmentedPager

本机

否则,如果您想在Native中解决,请自定义yourSelf


创建一个通用的UIScrollView,例如名称tblScroll
创建一个通用的UIView,例如Name viewSubBack'

UISCrollViewDelegate方法上

// this is the line for calculate the deviceWidth
#define KAPPDeviceWidth [[UIScreen mainScreen] bounds].size.width

- (void)scrollViewDidScroll:(UIScrollView *)sender
{

    if (self.tblScroll.contentOffset.x<KAPPDeviceWidth/2)
    {
        self.viewSubBack.frame=CGRectMake(self.tblScroll.contentOffset.x, 106, 160, 5); // the view changes related to your x - coordinates change
    }
    else
    {
        self.viewSubBack.frame=CGRectMake((KAPPDeviceWidth/2)+1, 106, 160, 5);
    }

}



对于Pods错误

删除工作区并再次运行pod install:

rm -rf MyProject.xcworkspace
pod install

关于ios - 如何在iOS中使用可滚动的自定义 View Controller 添加可滚动的标签栏,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/33207866/

10-11 14:51