【发布时间】:2013-02-16 07:58:59
【问题描述】:
我有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。这如何管理两个方向。
知道如何根据 Orientation OR bound 更改 setShadowPath 吗?
【问题讨论】:
标签: uiview orientation layer uibezierpath dropshadow