1
Googleマップで地図を実装しています。すべてのマーカーに画像があります。私の質問は、どうすればアイコンを丸くすることができますか? 私は古典的な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
これまでに試したコードを投稿できますか? – Vin