ios - Only top left corner is rounded instead of topLeft and bottomLeft -


i trying make uiview topleft , bottomleft corners rounded reason topleft has border radius. can cause this?

this doing:

i have extension:

extension uiview {     func roundcorners(_ corners: uirectcorner, radius: cgfloat) {         let path = uibezierpath(roundedrect: self.bounds, byroundingcorners: corners, cornerradii: cgsize(width: radius, height: radius))         let mask = cashapelayer()         mask.path = path.cgpath         self.layer.mask = mask     } } 

and apply view this:

myview.roundcorners([.topleft, .bottomleft], radius: 10.0) 

i using inside cell , using auto-layout.

at moment looks this(green view talking about) want bottomleft have corner radius also:

enter image description here

the problem timing. extension relies on self.bounds. if call extension early, such viewdidload, bounds have not yet been determined. view sized auto layout; means don't have bounds until view's layoutsubviews or view controller's viewdidlayoutsubviews has been called.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -