Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

add shadow to collection view cell swift

self.contentView.layer.cornerRadius = 2.0
self.contentView.layer.borderWidth = 1.0
self.contentView.layer.borderColor = UIColor.clear.cgColor
self.contentView.layer.masksToBounds = true

self.layer.shadowColor = UIColor.black.cgColor
self.layer.shadowOffset = CGSize(width: 0, height: 2.0)
self.layer.shadowRadius = 2.0
self.layer.shadowOpacity = 0.5
self.layer.masksToBounds = false
self.layer.shadowPath = UIBezierPath(roundedRect: self.bounds, cornerRadius: self.contentView.layer.cornerRadius).cgPath
Comment

PREVIOUS NEXT
Code Example
Swift :: swift self.present full screen 
Swift :: swift ui for loop high to low 
Swift :: swift ui int to binary 
Swift :: swift + data to string 
Swift :: double to string swift 
Swift :: convert image to base64 in swift ui 
Swift :: how to replace certain characters in string swift 
Swift :: get tabbar height swift 
Swift :: swift enum all cases 
Swift :: swift xcode debug cannot see code backtrace 
Swift :: swiftui text alignment 
Swift :: swiftui delay 
Swift :: swift get top constraint 
Swift :: swift javascript injection 
Swift :: swift http request header 
Swift :: how to get current shown collectionview cell index in swift 
Swift :: swift thread.sleep 
Swift :: swift setinterval 
Swift :: swift go to root view controller 
Swift :: struct vs enum swift 
Swift :: view controller modal fullscreen programmatically swift 5 
Swift :: how to remove item from list swift 
Swift :: swift get slected row data in tableview cell 
Swift :: swift programmatically set font 
Swift :: date format swift 
Swift :: xcode execute code after when navigating back to screen 
Swift :: swift enum storyboard 
Swift :: Optional & Default Parameter Swift 
Swift :: Swift Overloading with Different Parameter Types 
Swift :: while loops swift 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =