2016-09-19 6 views
1

Google지도가있는지도를 구현 중이며 모든 아이콘에 이미지가 있습니다. 내 질문은 : 아이콘을 둥글게하려면 어떻게해야합니까? 나는 classic layer.cornerRadius로 시도했지만 작동하지 않았습니다.GMS 라운드 아이콘

의 viewDidLoad

self.artistImageView = [[UIImageView alloc] init]; 
self.artistImageView.layer.cornerRadius = self.artistImageView.frame.size.width/2.0f; 
self.artistImageView.layer.borderWidth = 2.0f; 
self.artistImageView.layer.borderColor = [UIColor blackColor].CGColor; 
self.artistImageView.layer.masksToBounds = YES; 

및 populateMap 방법 :

FBMarker *marker = [FBMarker markerWithPosition:pin.coordinate]; 
marker.title = pin.title; 
self.artistImageView.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:artist.artistImage]]]; 
marker.icon = self.artistImageView.image; 
marker.subtitle = pin.subtitle; 
marker.phone = pin.phone; 
marker.map = self.mapView 
+0

지금까지 시도한 코드를 게시 할 수 있습니까? – Vin

답변

0

당신은 쉽게 모든 이미지 작업을 위해 이것을 사용할 수 있습니다 Toucan Swift

내 예 :

marker.icon = Toucan(image: marker.icon!).maskWithEllipse(borderWidth: 2, borderColor: UIColor.whiteColor()).image 

enter image description here

+0

Obj-C라면 좋을 것 같습니다. 내 프로젝트는 Obj-C입니다. 어쨌든 Thx :) – Mavericks13