首页 > 解决方案 > Placing layouts on top of each other - problem

问题描述

I have a relative layout tree, let's say that I have a couple of buttons in root layout and other one is placed on top of the buttons, covering them with it's backgound.

Visually everything is ok, but I still can activate invsible buttons placed under the layout, is there any property related to this?

I have tried elevation, translationZ, etc. I would like to avoid programatically fixing the problem (isShown for example), is there anything else I can change in xml to prevent them from activating?

enter image description here

标签: javaandroidandroid-studiolayout

解决方案


在您的布局 xml 文件中,添加setClickable="true"到您设置背景的相同布局。


推荐阅读