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
Post a Comment