简体   繁体   English

如何以编程方式在Google地图视图顶部添加UITextField?

[英]How can I add UITextField programmatically on top of a Google maps view?

I am trying to create a custom UITextField and add it on top of a GoogleMaps View (GMSMapView) It worked but the TextField is not responding to the touch event. 我正在尝试创建一个自定义UITextField并将其添加到GoogleMaps View(GMSMapView)的顶部,它可以工作,但是TextField没有响应触摸事件。 What am I doing wrong? 我究竟做错了什么? my code is: 我的代码是:

[self.mapView_ insertSubview:searchTextView atIndex:0];
[self.mapView_ bringSubviewToFront:searchTextView]; 

The textfield is visible on top of the mapview but not responding at all. 该文本字段在地图视图的顶部可见,但完全没有响应。

Apparently Google Maps view has a BlockingGestureRecognizer. 显然,Google Maps视图具有BlockingGestureRecognizer。 You need to remove that - worked for me. 您需要删除它-对我有用。

See the following answer: https://stackoverflow.com/a/20609357/1755778 请参阅以下答案: https : //stackoverflow.com/a/20609357/1755778

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

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