【发布时间】:2013-03-30 03:10:37
【问题描述】:
我有一个 UIView,其中包含一个部分位于 UIView 上的 UIButton。在 UIView 上绘制边框时出现问题。请看我的截图:
你可以看到边框在 UIButton 的上方,为什么?有人可以建议吗?谢谢
【问题讨论】:
-
用什么代码绘制边框和添加按钮?
-
您可以采用像 ContainerView parent of contentView & button 这样的视图结构。容器视图将是透明的(clearcolor),内容视图将具有边框和角。按钮将位于内容视图的顶部。你会得到你想要的确切屏幕。希望这会有所帮助..
-
我的代码很简单。在我看来:self.layer.cornerRadius = 15; self.layer.masksToBounds = YES; self.layer.borderColor = [[UIColor whiteColor] CGColor]; self.layer.borderWidth = 2.0f;