【问题标题】:UIImageView Border ProblemUIImageView边框问题
【发布时间】:2011-05-31 07:22:33
【问题描述】:

我正在为我的 UIImageView 子类添加边框,效果很好:

self.layer.borderColor = [UIColor whiteColor].CGColor;

self.layer.borderWidth = 10;

然而,在图像顶部添加 UIImageView 后,我注意到边框覆盖了图像!

UIImage*pin = [UIImage imageNamed:@"PinDown2"];

UIImageView*view = [[UIImageView alloc] initWithImage:pin];

view.frame = CGRectMake(self.bounds.size.width/2, 0, 32, 39);

[self addSubview:view];

我该如何解决这个问题?

【问题讨论】:

    标签: iphone objective-c ios cocoa-touch uiimageview


    【解决方案1】:

    如果你没有找到任何替代品,试试这个,

    Link 1

    或者这个,

    Link 2

    两者都来自同一个帖子。您还可以在那里找到其他答案。

    【讨论】:

      猜你喜欢
      • 2014-03-15
      • 2011-09-03
      • 1970-01-01
      • 2014-12-14
      • 2012-11-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多