पर फैली हुई है, मैं अपने UILabel में एक छाया का प्रसार बढ़ाना चाहता हूं लेकिन मुझे ऐसा करने के लिए संपत्ति नहीं मिल रही है। मैंने इस मुद्दे को स्पष्ट करने के लिए नीचे एक तस्वीर जोड़ा है।आईओएस - छाया UILabel
शीर्ष लेबल वांछित प्रभाव मैं में फ़ोटोशॉप बनाने में सक्षम हूँ। नीचे लेबल उन गुणों को दिखाता है जिन्हें मैं आईओएस में ढूंढने में सक्षम था। यहां कोड है जिसे मैंने नीचे लेबल के लिए उपयोग किया था।
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
मुझे छाया के रूप में दूसरे लेबल का उपयोग करने के लिए एक सुझाव मिला लेकिन यह वांछित परिणाम नहीं दिया। उस लेबल के लिए कोड यहां दिया गया है।
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
असल में वहाँ छाया के बारे में एक अच्छा लेख है https://makeapppie.com/2015/05/19/swift-swift-how-to-make-a-drop-shadow-in-user-interfaces/ –