ios - Add "shadow" to view -
i have cells 2 "rectangles". want is, add shadow right rectangle. better explained on screenshot:
from left first part of cell (first rectangle) , on right in second part. want add shadow on screenshot. tried:
-(void)addinnershadow{ self.bgdetailsview.layer.shadowcolor = [uicolor colorwithhexstring:@"#a4c2e0"].cgcolor; self.bgdetailsview.layer.shadowoffset = (cgsize){shadow_side_height,0}; // self.vselectionback.layer.shadowradius = 1.4; self.bgdetailsview.layer.shadowradius = shadow_side_height; self.bgdetailsview.layer.shadowopacity = .5; }
where bgdetailsview second (right) view, has no effect.
ok, understand want add shadow right view , shadow casts on left view.
to so:
you can set self.bgdetailsview.clipstobounds = no
, make shadow visible make shadow visible on , below right view.
you can put right view in container. set clipstobounds = no
in right view , make container view bit bigger left.
you can make container view additional calayer
or uiimageview
shadow image. put right view right of additional view/layer , set in container clipstobounds = no
.
you can use shadowpath
property of right view layer , put in container view:
self.bgdetailsview.layer.shadowpath = [uibezierpath bezierpathwithrect:shadowrect].cgpath;
Comments
Post a Comment