@android:颜色/透明不起作用

时间:2018-06-27 11:08:49

标签: android transparency

请注意

这不是活动/主题或清单的问题,而是include layout问题。

问题

在我的所有布局中,我都包含了progress_bar.xml布局,其中包含以下内容

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#80ffffff"
    android:layout_centerInParent="true"
    android:layout_gravity="center"
    android:orientation="vertical">

    <!--<ImageView-->
        <!--android:layout_width="match_parent"-->
        <!--android:layout_height="match_parent"-->
        <!--android:adjustViewBounds="true"-->
        <!--android:background="#80ffffff"-->
        <!--android:src="@drawable/splashscreen"-->
        <!--android:visibility="visible" />-->



        <ProgressBar
            android:id="@+id/defaultBigProgressBar"
            style="?android:attr/progressBarStyleLarge"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_marginBottom="8dp"
            android:indeterminate="false" />

        <ProgressBar
            android:id="@+id/defaultSmallProgressBar"
            style="?android:attr/progressBarStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_marginBottom="8dp"
            android:indeterminate="false"
            android:visibility="gone" />

</FrameLayout>

当我将其包含在其他一些布局中时,在xml文件的末尾

  <include
        android:id="@+id/progressBar"
        layout="@layout/progress_bar"
        android:background="#80ffffff"
        android:visibility="gone" />

progress_bar占据了整个屏幕,完全覆盖了另一个视图,完全没有任何透明度

我已经尝试了其他SO问题的thisother建议,但没有用。

这些无效

  • android:background =“ @ android:color / transparent”
  • convertView.setBackgroundColor(Color.TRANSPARENT);

0 个答案:

没有答案
相关问题