PagingMenuController icon indicating copy to clipboard operation
PagingMenuController copied to clipboard

Need a MenuViewCustomizable option that can add shadow to the menu.

Open DesmondPang opened this issue 9 years ago • 4 comments

Like some Google apps' design. The shadow can separate the menu and the content view if they have same colour. Thanks you.

DesmondPang avatar Oct 07 '16 07:10 DesmondPang

Like image below?

Here is my code for shadow. shadowColor, shadowOffset, shadowOpacity and shadowRadius will be options for that.

layer.shadowColor = UIColor.gray.cgColor
layer.shadowOffset = CGSize(width: 2, height: 2)
layer.shadowOpacity = 1
layer.shadowRadius = 0
layer.shadowPath = UIBezierPath(roundedRect: bounds, cornerRadius: 0).cgPath

simulator screen shot oct 9 2016 12 01 11

kitasuke avatar Oct 09 '16 19:10 kitasuke

I mean this kind of effect. I think you can set the view of the menu to public and then users can customise it they want through view.layer. Thank you so much. screen shot 2016-10-22 at 2 41 24 am

DesmondPang avatar Oct 21 '16 18:10 DesmondPang

Hi,

@DesmondPang do you find a way to do this?

fatgue avatar Apr 25 '17 12:04 fatgue

@kitasuke I believe the issue with this, is simply the order in which you're adding the views to the PagingViewController. If we were to add the pages BEFORE adding the MenuView, then anyone's app can add a shadow to the menu view (using standard code), and it would appear over the pages. Right now, because it is added before (and thus, has a lower "z-position" value), the pages appear over any shadow that is created.

I am open to making this change via a PR if you'd be willing to look at it and merge it?

cody1024d avatar Aug 01 '17 17:08 cody1024d