KitKat 4.4.2上的透明背景图像(Drawable)

时间:2016-07-04 04:48:38

标签: android android-layout background-image transparent alpha-transparency

我要在布局的背景上设置透明的可绘制图像,它在Lollipop +设备上工作正常,但是Pre-Lollipop设备上没有出现背景。 这是我的.xml代码。

<?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:visibility="visible"
    android:layout_below="@id/toolbar"
    android:id="@+id/emptyWorkFlowImage">


    <ImageView
        android:layout_width="434dp"
        android:layout_height="210dp"
        android:src="@drawable/bg_empty_sequence_list"
        android:id="@+id/ivEmptyLayout"/>

</RelativeLayout>

这是我透明的可绘制图像。 enter image description here

图片有一些文字和一个箭头..

1 个答案:

答案 0 :(得分:0)

尝试以编程方式进行。

relativeLayout.setBackgroundResource(R.drawable.ic_your_image);