android - FrameLayout buttons overlap, and can't be 'touched. - what's right way to access? -


I am using a frame layout and has two buttons, buttons A and button B (some other widgets Apart from) . A. Straight on top of B, is completely overlapping.

In OnCreate, I do a check and if A is not required, then I set it in Invisible. Later in the app it can be visible again, so I do not want to completely remove it.

When button B is pressed, then the answer is no. I think the button A is blocking A press even if it is invisible. Other buttons reply, so this is why I think so.

Is there a common way to do this, B then accepts touch? Do I have to remove A? I do not really want to remove A because I have a relative layout in the frame layout and for other control situations depend on A.

Personally, I think it will create a lot of buttons which, according to the properties based on the configuration Be different. However, if you really want two, then you can try a few things:

Set the invisible button to set the Set button to be Focusable or Not Touchable, Not Invisible . This is likely to be confused with the layout, because it basically says that the buttons are not considered while doing the layout.


Comments