uitableview - Round Top Corners of a UIView in Swift -
i trying round top corners using below code
func roundcorners(corners:uirectcorner, radius: cgfloat) { let path = uibezierpath(roundedrect: self.bounds, byroundingcorners: corners, cornerradii: cgsize(width: radius, height: radius)) let masklayer = cashapelayer() masklayer.frame = self.bounds masklayer.path = path.cgpath self.layer.mask = masklayer } use myview.roundcorners(corners:[.topleft, .topright], radius: radius)
but it's rounding 1 side of view:

this in tableview sectionheader if scroll down rounded using same code: 
and top discount view corners rounded using same function.
thank's help.
update if fix width on view works fine.
Comments
Post a Comment