これを実現する最善の方法は、GMSMapViewDelegate のメソッドを介して情報ウィンドウのカスタム ビューを GMSMapView に渡すことmapView:markerInfoWindow:
です。
これを実現するには、GMSMapView インスタンスのデリゲートとして自分自身を次のように設定します。
self.mapView.delegate = self;
次に、要求されたときにカスタム UIView を返します。
- (UIView *)mapView:(GMSMapView *)mapView markerInfoWindow:(id<GMSMarker>)marker
{
UIView *customView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
customView.backgroundColor = [UIColor redColor];
return customView;
}
GMSMapView ヘッダーを調べると、もう少し詳しい情報を見つけることができます。
/**
* Called when a marker is about to become selected, and provides an optional
* custom info window to use for that marker if this method returns a UIView.
* If you change this view after this method is called, those changes will not
* necessarily be reflected in the rendered version.
*
* The returned UIView must not have bounds greater than 500 points on either
* dimension. As there is only one info window shown at any time, the returned
* view may be reused between other info windows.
*
* @return The custom info window for the specified marker, or nil for default
*/