Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

add shadow to specific corner of UIView with shadow swift 6 site:stackoverflow.com

let containerV = UIView(frame: CGRect(x: 0, y: 0, width: self.frame.size.width , height: 50))
containerV.clipsToBounds = false
containerV.layer.shadowColor = UIColor.black.cgColor
containerV.layer.shadowOpacity = 1 
containerV.layer.shadowOffset = CGSize(width: -0.5, height: -3.0) 
/* since we dont want shadow at bottom */
containerV.layer.shadowRadius = 2
containerV.layer.shadowPath = UIBezierPath(roundedRect: containerV.bounds, 
cornerRadius: 10).cgPath

let headerLabel  = UILabel()
headerLabel.frame = containerV.bounds
headerLabel.text = "Test Header"
headerLabel.backgroundColor = UIColor.white

headerLabel.clipsToBounds = true
headerLabel.layer.cornerRadius = 10
if #available(iOS 11.0, *) {
        headerLabel.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]
    } else {
        // Fallback on earlier versions
    }
containerV.addSubview(headerLabel)
Comment

PREVIOUS NEXT
Code Example
Swift :: swiftui textfield editable false 
Swift :: white status bar swift 
Swift :: swift try catch 
Swift :: swift file size from url 
Swift :: swift inheritance 
Swift :: switch button swift 5 
Swift :: swift struct 
Swift :: declaring optionals swift 
Swift :: swift add navigation bar 
Swift :: how to recieve hex value from NSData swift 
Swift :: swift show title on navigation bar programmatically 
Swift :: uitextfield set max length 
Swift :: polymorphism in swift 
Swift :: swift create lazy property 
Swift :: two integer value sum in swift 
Swift :: Swift Syntax of guard Statement 
Swift :: Swift Add/Remove Elements From Tuple 
Swift :: Log httpurlresponse swift 
Swift :: Swift enum With Switch Statement 
Swift :: Swift Equatable Protocol 
Swift :: xcode create image from calayer 
Swift :: how to get list of value from specific keys in array object in swift 
Swift :: swift 5 uidatepicker display inline 
Swift :: ns transport swift code 
Swift :: xamarin get textview by id 
Swift :: How to make dart typing stricter 
Swift :: sizetofit not working swift 
Ruby :: rails send test email 
Ruby :: eager load polymorphic rails 
Ruby :: rails g model references 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =