我使用一张240*320的图片放在布局里面做背景,但显示在真机(分辨率240*320)上时背景会失真,模糊不清的。有没有人遇到这种问题,怎么解决啊?
我的布局如下:<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/welcome"
/>
</LinearLayout>
我的布局如下:<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/welcome"
/>
</LinearLayout>
解决方案 »
- app inventor应该怎样禁止程序的屏幕旋转呢?
- 手写签名技术是怎么实现的?高手给点思路,谢谢!
- eclipse 运行 android 的问题
- 读《android游戏开发入门》遇到问题求教
- android网络相册软件,连接网址,并浏览网站上的相册,请问如何操作
- android FM和Camera问题
- 救命:新买的htc incredible 装不上驱动
- 有没有用Google手机的啊?
- 使用DexClassLoader加载dex,已经加载的类遇到findLoadedClass失败的问题
- Android studio 开发这个错误是为什么
- 如何在JNI层利用Opengl ES显示YUV数据?
- android欢迎动画调转问题 送分!
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:scaleType="fitXY"
/>
Resources r = getResources();
//以数据流的方式读取资源
InputStream is = r.openRawResource(R.drawable.welcome);
BitmapDrawable bmpDraw = new BitmapDrawable(is);
Bitmap bmp = bmpDraw.getBitmap();
image1.setImageBitmap(bmp);