gpt4 book ai didi

iphone - 像google plus一样查看开关

转载 作者:行者123 更新时间:2023-11-28 18:26:13 25 4
gpt4 key购买 nike

是否有任何示例代码,例如 google plus 之类的 View 切换,从附近到圈子到传入?

enter image description here

最佳答案

@Hubert 我对你的代码做了一些调整,现在你可以滚动 topScrollView 并移动 bottomScrollView 代码

- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
if (scrollView == self.bottomScrollView) {
//i dont know where this number came from 2.46153846
float bOffset = self.bottomScrollView.contentOffset.x/2.66666666666667;
NSLog(@"%f",self.bottomScrollView.contentOffset.x);
NSLog(@"%f",self.topScrollView.contentOffset.x);
CGPoint theOffset = CGPointMake(self.bottomScrollView.contentOffset.x, self.topScrollView.contentOffset.y);
theOffset.x = bOffset;

[self.topScrollView setContentOffset:theOffset animated:NO];
}
// if the TopScrollView is Moved
if (scrollView == self.topScrollView) {
float bOffset = self.topScrollView.contentOffset.x*2.66666666666667;
CGPoint theOffset = CGPointMake(self.topScrollView.contentOffset.x, self.bottomScrollView.contentOffset.y);
theOffset.x = bOffset;

[self.bottomScrollView setContentOffset:theOffset animated:NO];
}

关于iphone - 像google plus一样查看开关,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8642391/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com