I have UiTableView within UiView
. I want to set corner radius & shadow
to UIView
.
I am using this code to give shadow with corner
and its working fine.
myView.backgroundColor = [UIColor clearColor];
[myView.layer setCornerRadius:10.0f];
[myView.layer setBorderColor:[UIColor lightGrayColor].CGColor];
[myView.layer setBorderWidth:1.0f];
[myView.layer setShadowColor:[UIColor blackColor].CGColor];
[myView.layer setShadowOpacity:0.8];
[myView.layer setShadowRadius:3.0];
[myView.layer setShadowOffset:CGSizeMake(2.0, 2.0)];
// below line is for smooth scrolling
[myView.layer setShadowPath:[UIBezierPath bezierPathWithRect:myView.bounds].CGPath];`
everything working fine with Portrait mode
. My app is supported both Orientation
and we are using Autoresizing property
fot that. When i change the orientation Shadow is displaying according to frame of Portrait mode
. How can this manage for both Orientation.
Any idea how to change setShadowPath
according to Orientation OR bound ?