iphone - how to set cornerRadius for only top-left and top-right corner of a UIView? -


is there way set cornerradius top-left , top-right corner of uiview?

edit:

i tried following, end not seeing view anymore. wrong code below?

uiview *view = [[uiview alloc] initwithframe:frame];  calayer *layer = [calayer layer]; uibezierpath *shadowpath = [uibezierpath bezierpathwithroundedrect:frame byroundingcorners:(uirectcornertopleft|uirectcornertopright) cornerradii:cgsizemake(3.0, 3.0)]; layer.shadowpath = shadowpath.cgpath; view.layer.mask = layer; 

pay attention fact if have layout constraints attached it, must refresh follows:

 override public func layoutsubviews() {         super.layoutsubviews()         roundcorners(corners: [.bottomleft, .bottomright], radius: uiflashlabel.cornerradius)     } 

if don't won't show up.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -