UITextInput - 如何让它添加标准选择手势识别器?
有没有办法说服 iOS 将标准手势识别器附加到实现 UITextInput 的自定义视图?
我已经实现了 UITextInput 的所有方法,我正在绘制选择、光标并标记自己。我发现长按标记文本会显示矩形系统放大镜。这告诉我,在某些情况下,触摸处理是由系统提供的。
有没有一种方法可以让标准选择手势也可以工作,而不必添加一堆触摸处理代码并自己绘制放大镜?
Is there a way to persuade iOS to attach the standard gesture recognizers to a custom view that implements UITextInput?
I have implemented all methods of UITextInput, I am drawing selection, the cursor and marking myself. I found that long-pressing on marked text shows the rectangular system loupe. This tells me that there are situations when the touch handling IS provided by the system.
Is there a method to get the standard selection gestures also working without having to add a bunch of touch handling code and drawing the loupes yourself?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
遗憾的是,没有。您必须自己实施所有这些。在 WWDC 期间,我花了很多时间在高级文本实验室,对那些编写大部分核心文本的人进行窃听。如果您使用标签来进行一些绘图,那么系统功能会在一些奇怪的地方发挥作用。但在当前的 SDK 中,我们运气不佳。
Sadly, no. You have to implement all of that yourself. I spent a great deal of time in the Advanced Text lab while at WWDC, bugging the guys who wrote most of Core Text. There are some odd bits where system functionality shines though, if you use a label to do some of the drawing. But in the current SDK, we are out of luck.