繁体   English   中英

像辅助触摸一样的移动按钮

[英]Moving button like assistive touch

嗨,我想在我的应用程序中移动一个 uibutton 的位置,就像我们在 iphone 中有辅助触摸一样,我希望在我的应用程序中使用那种按钮。一些链接

这个问题被问了很多次......这里是答案

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {

        UITouch *touch = [[event allTouches] anyObject];
        CGPoint touchLocation = [touch locationInView:self.view];
        button.frame.x = touchlocation.x;
        button.frame.y = touchlocation.y;
    }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM