我有UiTableView within UiView。我想设置corner radius & shadow为UIView. 我正在使用此代码来提供shadow with corner并且工作正常。
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];`
一切正常Portrait mode。我的应用程序都受支持Orientation,我们正在使用Autoresizing property它。当我改变方向时Shadow is displaying according to frame of Portrait mode。这如何管理两个方向。
知道如何setShadowPath根据 Orientation OR bound 进行更改吗?