我在我的iOS應用程序中使用ECSlidingController
。我已經檢查過要求和演示。 ECSlidingController以我想要的方式工作,但仍然無法添加任何視圖。使用ECSlidingController時陰影不可見
這裏我做什麼,這是基本視圖控制器(DetailViewController
是的UIViewController),這將成爲觸發滑動視圖,它的名字DetailContextViewController
(左或右不會在所有問題):
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
self.view.layer.shadowOpacity = 0.75f;
self.view.layer.shadowRadius = 10.0f;
self.view.layer.shadowColor = [UIColor blackColor].CGColor;
if (![self.slidingViewController.underRightViewController isKindOfClass:[DetailContextViewController class]]) {
self.slidingViewController.underRightViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"DetailAbout"];
}
}
而且這裏是DetailContextViewController(這是一個UIViewController中太):
- (void)viewDidLoad
{
[super viewDidLoad];
self.peekLeftAmount = 40.0f;
[self.slidingViewController setAnchorLeftPeekAmount:self.peekLeftAmount];
self.slidingViewController.underRightWidthLayout = ECVariableRevealWidth;
}
我已經添加QuartCore.h
和檢查的TabBar的屬性,即夾子視圖是false
。我也試過TableView
的影子,所以用self.tableView.layer改變了self.view.layer並且不能再設置陰影。
有什麼不對嗎?
任何幫助將是偉大的。
這僅僅是我還是會引入驚人數量的視覺延遲/呃逆?我最終渲染了一個影子資產,並將其放置在我的topViewController左側的imageview中。似乎是在iOS 6/7 UIKit上使用陰影圖層的普遍問題。 – Dinkman123 2014-06-24 01:04:17
@ Dinkman123我一直在甩掉我的頭髮來處理同樣的事情。從作者來看,「1.x爲你設置shadowPath,2.x不會」。 https://github.com/ECSlidingViewController/ECSlidingViewController/issues/224 – 2014-09-01 23:10:03
@MarkPhillip我通常避免使用圖層陰影,我在這裏看到性能問題以及許多其他使用內置圖層陰影功能的情況。將自己的陰影渲染爲半透明資源並且性能遠遠優於其他設備非常容易。 – Dinkman123 2014-09-02 23:18:24