问题
I have two containers on a layered layout say c1 and c2. c1 has a lot of buttons, drag n drop etc. c2 has a translucent background for the entire screen with a centre aligned image and a close button.
I need to be able to automatically disable all actions for c1 when c2 is added over c1. While I can handle this programatically when c2 is added over c1 during runtime, it would great to automatically disable all events for c1.
Is there a better way to handle this ?
Thanks
回答1:
I think making the top layer focusable should grab the events from the underlying component. Haven't tested it though.
来源:https://stackoverflow.com/questions/25852251/codenameone-layered-layout