如何降低布局的亮度?

时间:2017-03-01 00:53:53

标签: android android-layout

我想知道如何降低某些布局的亮度(我猜他们这样做了)? 就像在这张图片中: enter image description here

我试过,将android:alpha设置为0,6,但它不起作用。 我将不胜感激任何帮助。

修改 这是我的布局,我只是在测试。

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="debugging.transparenttest.MainActivity">

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World!" />

</LinearLayout >

2 个答案:

答案 0 :(得分:0)

您必须更改活动背景的不透明度,如下所示:

  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/container"
          android:layout_width="match_parent"
          android:layout_height="match_parent"                
          android:background="#80000000"> 

80,如果这里有FF的一半

答案 1 :(得分:0)

这不是降低亮度,这是另一个活动

相关问题