如何不为特定视图提供叠加层

时间:2018-01-01 11:16:17

标签: android android-overlay

我的活动有黑色透明覆盖。

我需要做的是删除活动中特定按钮的叠加层。但是所有其他部分提取按钮都将包含叠加层。

1 个答案:

答案 0 :(得分:0)

您可以添加带黑色叠加层的视图。使用RelativeLayout是一个很好的解决方案。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:background="@mipmap/ic_launcher">
   <Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Press Me"/>
   <View
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#8000"/>
</RelativeLayout>

希望这有帮助。

感谢。

相关问题