尝试在 MKAnnotation 中添加 UIImage
我尝试在 MKAnnotation 中使用 UIImage:
UIView *leftCAV = [[UIView alloc] initWithFrame:CGRectMake(0,0,32,32)];
leftCAV.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"..."]];
pin.leftCalloutAccessoryView = leftCAV;
代码已运行,但没有透明背景
请参阅:
http://img19.imageshack.us/f/1234wr.png/
有想法吗?
谢谢 :)
I try to have a UIImage in a MKAnnotation:
UIView *leftCAV = [[UIView alloc] initWithFrame:CGRectMake(0,0,32,32)];
leftCAV.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"..."]];
pin.leftCalloutAccessoryView = leftCAV;
The code is run, but I don't have a transparent background
See that:
http://img19.imageshack.us/f/1234wr.png/
Have an idea?
thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有什么理由不只使用 imageView 吗?
Any reason not just using an imageView?
你尝试过吗:
?
我假设你的图像是 32x32。它有透明背景吗? (我无法判断我在您提供的链接中看到的内容是否是您想要的。该网站上发生的事情太多了!:-)
Did you try:
?
I'll assume your image is 32x32. Does it have a transparent background? (I could not tell if what I was looking at at the link you provided was what you intended. There's too much going on on that site! :-)
添加此
leftCAV.opaque=NO;
。Add this
leftCAV.opaque=NO;
.