我连续有x个视图:
[view1] [view2] [view3]
我需要能够拖动和重新排序它们中的任何一个(仅在水平方向),还需要插入新视图.
你会如何实现这个?
我猜是这样的:
- (void)didDragView:(UIView *)currentView
{
for (UIView *v in self.viewsArray)
{
if (currentView.center.x < v.center.x)
// Move view to index: [self.viewsArray indexOfObject:v];
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
730 次 |
| 最近记录: |