2
嗨,我使用谷歌地圖中,我想用標誌像下面的圖片 IOS谷歌地圖自定義標記
我已經做了代碼
UIView *markerview = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 55, 102)];
markerview.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"glow-marker2.png"]];
UIImageView *imgview = [[UIImageView alloc] initWithFrame:CGRectMake(4, 4, 47, 70)];
imgview.backgroundColor = [UIColor whiteColor];
imgview.contentMode = UIViewContentModeScaleAspectFit;
imgview.image = img;
imgview.layer.cornerRadius = 7;
imgview.layer.masksToBounds = YES;
[markerview addSubview:imgview];
marker.icon = [self imageWithView:markerview];
marker.map = mapview;
它給我輸出
誰能告訴我爲什麼這黑色背景來了?如何解決?