我正在开发需要使用自定义弹出窗口的地图应用程序。我已经添加了自定义视图,但我无法设置自定义弹出窗口的位置
这是我的代码
- (UIView *)mapView:(GMSMapView *)mapView markerInfoWindow:(GMSMarker *)marker {
UIView *view=[[UIView alloc]initWithFrame:CGRectMake(0, 0, 156, 36)];
UIImageView *imgView=[[UIImageView alloc]initWithFrame:view.frame];
[imgView setImage:[UIImage imageNamed:@"markerBg.png"]];
[view addSubview:imgView];
UIImageView *imgRightArrow=[[UIImageView alloc]initWithFrame:CGRectMake(130, 13, 8, 10)];
[imgRightArrow setImage:[UIImage imageNamed:@"arrow1.png"]];
[view addSubview:imgRightArrow];
UILabel *lbl=[[UILabel alloc]initWithFrame:CGRectMake(20, 0, 110, 36)];
[lbl setText:marker.title];
[lbl setBackgroundColor:[UIColor clearColor]];
[lbl setTextColor:[Utility getColor:@"00AAE8"]];
[lbl setFont:[UIFont systemFontOfSize:12.0f]];
[view addSubview:lbl];
return view;
}