星空网 > 软件开发 > 操作系统

九:UIView的拖拽

  做出来效果:屏幕上的一块UIView,点击后能自由移动

 1 #import "GreenView.h" 2 @implementation GreenView 3 - (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event 4 { 5   UITouch *touch = [touches anyObject]; 6   CGPoint currentP = [touch locationInView:self]; 7   CGPoint previousP = [touch previousLocationInView:self]; 8   CGFloat offsetX = currentP.x - previousP.x; 9   CGFloat offsetY = currentP.y - previousP.y;10   self.transform = CGAffineTransformTranslate(self.transform, offsetX, offsetY);11 }12 @end

 




原标题:九:UIView的拖拽

关键词:ie

ie
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

亚马逊 “经济制裁 ”FedEx,顺丰 还最该看中 吗?:https://www.ikjzd.com/articles/113797
干货:亚马逊促销设置图文实操教程!:https://www.ikjzd.com/articles/113798
如何应对速卖通物流价格上调?:https://www.ikjzd.com/articles/113799
eBay宣布更新用户协议:eBay卖家对listing没有全部控制权:https://www.ikjzd.com/articles/1138
亚马逊威胁员工:公开批评公司气候政策将被开除:https://www.ikjzd.com/articles/113801
亚马逊正考虑在德国开设实体零售店:https://www.ikjzd.com/articles/113805
独家对话爆剧操盘手刘羽砚:短剧凭什么让2亿人花钱观看? :https://www.kjdsnews.com/a/1836539.html
大牌退烧 白牌雄起? :https://www.kjdsnews.com/a/1836540.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流