任何示例代碼,如視圖開關,如谷歌加,附近圈到接收?查看開關,如谷歌加
0
A
回答
2
我做這個很相似,你想要什麼,我認爲。
0
如果我明白你的問題正確,這將幫助。這裏Title2視圖添加了動畫,同時Title1.view被刪除。你可以寫類似的代碼進行正確的過渡
-(void)handleLeftTransition:(id)sender
{
if(![self.view.subviews containsObject:title2.view])
{
title2.view.frame = CGRectMake(320, 20, 320, 350);
[self.view addSubview:title2.view];
[UIView animateWithDuration:0.5f
animations:^{
title2.view.frame = CGRectMake(0, 20, 320, 350);
title1.view.frame = CGRectMake(-320, 20, 320, 350);
}
completion:^(BOOL finished){
if([self.view.subviews containsObject:title1.view])
[title1.view removeFromSuperview];
}];
}
}
4
@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];
}
}
0
是that你想找什麼?
相關問題
- 1. 谷歌街道查看API
- 2. 打開谷歌地圖iOS應用內查看
- 3. 谷歌地圖 - 查看相關的街景從infowindow按鈕
- 4. 谷歌Chrome PDF查看器:媒體
- 5. 谷歌分析查看由用戶ID
- 6. 谷歌文檔查看器,在IE
- 7. 谷歌文檔查看器的API
- 8. 安卓網站查看谷歌登錄
- 9. 試圖預緊谷歌地圖查看
- 10. 谷歌文檔查看器不工作
- 11. 谷歌開
- 12. 谷歌融合表添加列以查看
- 13. 信號SIGABRT錯誤,當添加谷歌地圖查看
- 14. 谷歌加或Facebook風格的圖像彈出查看器?
- 15. 檢查谷歌reCaptcha服務是打開還是關閉
- 16. 如何使月份查看日曆如谷歌日曆?
- 17. 谷歌加應用開發語言
- 18. 谷歌查詢
- 19. 如何查看谷歌驅動器中的C#.cs文件?
- 20. 如何查看谷歌雲虛擬機實例RAM利用率
- 21. 我如何查看谷歌地球的系統控制檯?
- 22. 如何查看帳戶的谷歌Apps腳本配額
- 23. 在谷歌加載谷歌圖表
- 24. 左在谷歌大查詢加入
- 25. 添加參數到谷歌查詢
- 26. 使用谷歌瀏覽器打開/查看/修改請求標題之前
- 27. 谷歌玩開發商分銷協議。在哪裏可以查看並同意
- 28. 尋找一個網頁pdf查看器,而不是谷歌文檔查看器
- 29. 查詢谷歌表
- 30. 谷歌QPX查詢
不錯。我將它添加到代碼中。 – 2012-01-07 14:18:18
@Alex 2.66666666666667是從哪裏來的? – 2012-03-05 10:06:49
ohh這是我的錯誤...如果我沒有錯...這是scrollview的大小劃分的視圖的大小或類似的東西...但它的錯誤...正確的數字是2.46153846 ...對不起關於那個 – Alex 2012-03-05 18:03:52