我有一個視圖在iPad中。 在這個觀點上,我有四個按鈕。 現在,當我點擊那個按鈕時,一個視圖打開一些固定的高度,寬度,x位置和y位置。 我想讓這個新視圖可以停靠。 我的意思是我想把這個視圖拖到那個大視圖的任何地方。使視圖浮在一些其他視圖
0
A
回答
0
0
您可以在您的情況優化這個..
-(void)dragging:(UIPanGestureRecognizer *)gesture
{
if(gesture.state == UIGestureRecognizerStateBegan)
{
//NSLog(@"Received a pan gesture");
self.panCoord = [gesture locationInView:gesture.view];
}
CGPoint newCoord = [gesture locationInView:gesture.view];
float dX = newCoord.x-panCoord.x;
float dY = newCoord.y-panCoord.y;
gesture.view.frame = CGRectMake(gesture.view.frame.origin.x+dX, gesture.view.frame.origin.y+dY, gesture.view.frame.size.width, gesture.view.frame.size.height);
}
相關問題
- 1. 如何使視圖在IME中的其他視圖之上浮動?
- 2. 影響其他視圖的視圖
- 3. 包含視圖內的其他視圖
- 4. 檢查其他視圖中的視圖?
- 5. iOS - 其他視圖內的視圖
- 6. 使用其他圖像視圖標籤創建圖像視圖
- 7. UILabel linebreak在其他視圖
- 8. 如何在拖動其他視圖時移動一個視圖
- 9. 一個視圖中其他視圖在asp.net mvc的
- 10. 浮動列表視圖在其它視圖
- 11. 如何從一個視圖執行其他視圖的動作
- 12. 如何將一個視圖導航到其他視圖
- 13. 一個根視圖控制器,管理所有其他視圖?
- 14. 某些事件在周視圖和其他日間視圖中缺失,但在月視圖中顯示
- 15. CGAffine轉換其他視圖
- 16. 類控制其他視圖
- 17. Nodejs包含其他視圖?
- 18. 的Android onTouch其他視圖
- 19. SlidingDrawer上方其他視圖
- 20. 更改其他視圖
- 21. UIView模糊其他視圖
- 22. 使用回收視圖訪問其他視圖android studio
- 23. iPhone使用其他視圖添加視圖
- 24. 如何使列表視圖與其他視圖關聯?
- 25. 使用setScaleY縮放視圖不會移動其他視圖
- 26. 視頻視圖和其他視圖重疊問題
- 27. iPhone:一些視圖其他景觀風景
- 28. MKMapView:將一些註釋視圖添加到其他人之上?
- 29. 在所有其他視圖上添加重疊視圖
- 30. 在其他視圖中更新集合視圖
什麼panCoord指示? –