I have a view. I am making a border with these runtime attributes:
The problem is layer.borderColorwhen I set the borderColor my border is gone, but when I don't set the border. Is my color a black frame that I don’t want any ideas?
layer.borderColor
, layer.borderColor CGColor User defined runtime attributes UIColor not CGColor, , borderColor .. black. borderColor, .
CGColor
User defined runtime attributes
UIColor
borderColor
black
Swift 3
yourView.layer.borderColor = UIColor.red.cgColor //set your color here
Swift 2.3
yourView.layer.borderColor = UIColor.redColor().CGColor //set your color here
, @NiravD, borderColor, borderWidth layer, .
borderWidth
layer
Swift 3 Swift 4:
circle.layer.cornerRadius = 5.0 circle.layer.borderColor = UIColor.red.cgColor circle.layer.borderWidth = 2.0
in Swift 3.0
@IBOutlet weak var viewMainCell: UIView! viewMainCell.layer.shadowOpacity = 0.5 viewMainCell.layer.shadowRadius = 5 viewMainCell.layer.shadowColor = UIColor.black.cgColor viewMainCell.layer.cornerRadius = 5 viewMainCell.layer.masksToBounds = false
Source: https://habr.com/ru/post/1665510/More articles:Failed to connect DB processing in laravel? - phpWhy does the target attribute set to "_top" or "_parent" open in a new tab - jqueryhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1665507/how-to-use-css-animations-to-create-a-cubes-opening-like-in-the-picture&usg=ALkJrhiT3mggcbRoplqd2XgRudsYN1prZQHow to remove ^ M characters from a text file regardless of platform using Java? - javaUnexpected char '\' build.gradle - androidHow to execute GraphQL query from server - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1665512/identityserver4-identityserver3accesstokenvalidation&usg=ALkJrhhV2XKO55KVzIzdou34b7UrX2IVfALinux block device - finding a simple example - kernelМаска Unity ui не работает с пиксельным устройством Google - androidДата выпуска ZingChart - javascriptAll Articles