私は持ってい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オリエンテーションまたはバウンドに従って変更する方法はありますか?