【发布时间】:2015-03-02 22:20:19
【问题描述】:
我在 android 的框架布局内添加了一个内部图像。但问题是我得到了一个白色背景。我需要删除那个白色背景。任何帮助将不胜感激.....
截图如下
xml文件如下
<?xml version="1.0" encoding="UTF-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:id="@+id/imageView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="center"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:background="@null"
android:maxWidth="-5dp"
android:maxHeight="-5dp"
android:src="@drawable/driveimg"
/>
</FrameLayout>
【问题讨论】:
-
不,它没有透明背景
-
仅出于测试目的将您的驱动器图像替换为 android 图标的默认图像,即 ic_launcher。查看结果。
-
你使用的图片应该有透明背景...
-
好吧,让我看看.....
-
谢谢 Mike 和 A.R
标签: android image android-layout android-xml