【发布时间】:2014-06-02 10:01:27
【问题描述】:
我需要在相机预览中设置一个透明图像,我需要对其进行放大和缩小。
我有相机预览,在顶部的布局中我放了一个带有图像的图像视图。这张图片只有一个边框,中间是透明的,但是我看不到相机预览,我只看到白色背景的图片。
这是我的 XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearlayout"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/imageView"
android:layout_gravity="left|top" android:scaleType="fitXY"
android:src="@drawable/red"/>
<FrameLayout
android:id="@+id/camera_preview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
>
</FrameLayout>
</LinearLayout>
如果图像是透明的,为什么要设置白色背景?
谢谢
【问题讨论】:
标签: android android-layout android-camera