我目前正在使用google maps ios SDK创建并返回自定义视图,方法是将委托设置为self并使用以下代码.
#pragma mark - GMSMapViewDelegate
-(UIView*)mapView:(GMSMapView *)mapView markerInfoWindow:(id<GMSMarker>)marker {
int popupWidth = 200;
int contentWidth = 180;
int contentPad = 10;
int popupHeight = 140;
int popupBottomPadding = 16;
int popupContentHeight = popupHeight - popupBottomPadding;
int buttonHeight = 30;
UIView *outerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, popupWidth, popupHeight)];
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, popupWidth, popupContentHeight)];
[view setBackgroundColor:[UIColor whiteColor]];
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(contentPad, 0, contentWidth, 22)];
[titleLabel setFont:[UIFont systemFontOfSize:17.0]];
titleLabel.text = [marker title];
UILabel …Run Code Online (Sandbox Code Playgroud) 我已将ios的Google地图sdk添加到我的Iphone应用程序中,如果点击的信息窗口弹出标题,我有一些自定义标记,如何在此信息窗口中添加按钮,如果按下将转到新页面?现在我已经尝试使用这篇文章来解决这个问题在Google Maps SDK中为InfoWindow/Marker添加点击事件以获取原生iOS /目标C它不会给我错误但它不起作用.
这就是我想要的结果:http://www.flickr.com/photos/74719051@N05/6728157477/
objective-c button google-maps-markers ios google-maps-sdk-ios