防止图像叠加拉伸

时间:2012-05-08 11:15:20

标签: android android-imageview

我的ImageView有一个图像叠加文件,但不幸的是,当图像显示为叠加时,图像会被拉伸。

这是我的叠加图像xml文件:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content" >

    <item android:drawable="@drawable/btn_play" />
</layer-list>

以下是我如何将叠加层实现到我的ImageView

ImageView imageView = new ImageView(this);
        try {
            imageView.setBackgroundDrawable(drawable_from_url(thumbnail_url,
                    thumbnail_url));
        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        imageView.setImageDrawable(getResources().getDrawable(R.layout.video_layer));

有人知道如何防止叠加图像拉伸吗?

0 个答案:

没有答案
相关问题