PDA

View Full Version : [iOS]SKCalloutView customising



high5fly
24.03.2016, 10:59
Hi,

would you please provide an example of how I can change buttons images and the background colour of standard SKCalloutView?

KR,
Milo

Adela_Silvia
29.03.2016, 12:52
An example of using the SKCalloutView class you will find in our getting started guide in the "Configuring visual elements" chapter: http://developer.skobbler.com/getting-started/android#sec007

high5fly
29.03.2016, 12:54
Hi would you please provide it for iOS, and I am most interest of setting background colour for the whole callout view.

Adela_Silvia
18.04.2016, 13:59
On iOS you have to override the calloutViewForAnnotation callback: http://developer.skobbler.com/docs/ios/Protocols/SKMapViewDelegate.html#//api/name/mapView:calloutViewForAnnotation:
You'll find an example in the demo project (inside AnnotationsViewController.m) where you can create a user defined UIView and return that:


- (UIView*)mapView:(SKMapView *)mapView calloutViewForAnnotation:(SKAnnotation *)annotation
{
//Custom callouts.
if (annotation.identifier == self.annotation1.identifier)
{
UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0.0f, 0.0f, 200.0f, 50.0f)];
view.backgroundColor = [UIColor purpleColor];
view.alpha = 0.5f;
return view;
}

return nil;// Default callout view will be used.
}