2016-05-19 185 views
2

我使用下面的代碼顯示陰影。從ViewController刪除陰影

UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRect:CGRectMake(317, 0, 1, self.navigationController.view.frame.size.height)]; 
     self.navigationController.view.superview.layer.masksToBounds = NO; 
     self.navigationController.view.layer.shadowColor = [UIColor blackColor].CGColor; 
     self.navigationController.view.layer.shadowOffset = CGSizeMake(3, 0); /*Change value of X n Y as per your need of shadow to appear to like right bottom or left bottom or so on*/ 
     self.navigationController.view.layer.shadowOpacity = 0.5f; 
     self.navigationController.view.layer.shadowPath = shadowPath.CGPath; 

我想刪除這個陰影。我試過一些東西,但沒有工作?任何幫助表示讚賞。

回答

0

嘗試通過更換balckColor到clearColor,不透明度爲0.0

self.navigationController.view.layer.shadowColor = [UIColor clearColor].CGColor; 
self.navigationController.view.layer.shadowOpacity = 0.0f; 
+0

這對我有用!謝謝...... – Nikhil

+0

歡迎@Nikhil,是的,謝謝你接受答案。 –

0

你能不能只設置不透明度爲0.0。

self.navigationController.view.layer.shadowOpacity = 0.0; 

謝謝!!