Cocoa Touch: How To Change UIView's Border Color And Thickness?

后端 未结 14 1089
心在旅途
心在旅途 2020-11-30 16:56

I saw in the inspector that I can change the background color, but I\'d like to also change the border color and thickness, is this possible?

14条回答
  •  感动是毒
    2020-11-30 17:16

    If you didn't want to edit the layer of a UIView, you could always embed the view within another view. The parent view would have its background color set to the border color. It would also be slightly larger, depending upon how wide you want the border to be.

    Of course, this only works if your view isn't transparent and you only want a single border color. The OP wanted the border in the view itself, but this may be a viable alternative.

提交回复
热议问题