UILabel'ımdaki bir gölgenin yayılmasını artırmak istiyorum ancak bunu yapmak için özellik bulamıyorum. Sorunu göstermek için aşağıdan bir fotoğraf ekledim.iOS - Shadow yayıldı UILabel
üst Etiket ben Photoshop oluşturmak mümkün duyuyorum istenen etkidir. En alttaki Etiket, iOS'ta bulabildiğim özellikleri gösterir. İşte alt etiket için kullandığım kod.
let bottomLabel = UILabel(frame: CGRectMake(0, 0, maxWidth, 18))
bottomLabel.backgroundColor = UIColor.clearColor()
bottomLabel.textColor = UIColor.whiteColor()
bottomLabel.font = UIFont.boldSystemFontOfSize(16)
bottomLabel.text = title
bottomLabel.textAlignment = .Center
bottomLabel.numberOfLines = 1
bottomLabel.layer.shadowOffset = CGSize(width: 0, height: 0)
bottomLabel.layer.shadowOpacity = 1
bottomLabel.layer.shadowRadius = 2
İkinci bir etiketi gölge olarak kullanmak için bir öneri buldum, ancak bu istenen sonucu vermedi. İşte o etiketin kodu.
let bottomLabelShadow = UILabel(frame: CGRectMake(0, 1, maxWidth, 18))
bottomLabelShadow.backgroundColor = UIColor.clearColor()
bottomLabelShadow.textColor = UIColor.blackColor()
bottomLabelShadow.font = UIFont.boldSystemFontOfSize(16)
bottomLabelShadow.text = title
bottomLabelShadow.textAlignment = .Center
bottomLabelShadow.numberOfLines = 1
bottomLabelShadow.layer.shadowOffset = CGSize(width: 0, height: 0)
bottomLabelShadow.layer.shadowOpacity = 1
bottomLabelShadow.layer.shadowRadius = 2
Aslında https://makeapppie.com/2015/05/19/swift-swift-how-to-make-a-drop-shadow-in-user-interfaces/ gölgeler hakkında iyi makale olduğunda –