我创建了非常简单的android应用程序,它显示图像。 代码:ImageView我无法显示图像
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
activity_main.xml中
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/textView1"
android:scaleType="matrix"
android:src="@drawable/img_big_size"
/>
</RelativeLayout>
此外我有两个相同的图片,第一img_big_size.jpg(尺寸468 KB)和第二img_small_size.jpg(尺寸192 KB)。 第一个图像具有更高的分辨率,因此需要比第二个图像更多的内存。 当我尝试显示第二个图像(img_small_size.jpg)应用程序工作正常,并显示图像。 但是,当我尝试显示拳头图像(img_small_size.jpg)应用程序不显示图像只显示黑屏。为什么我的应用程序无法显示第一个图像如何显示第一个图像?
我想显示第一张图片,因为当我首先放大图片时,图片比第二张图片更清晰。 。
链接到图片: http://zapodaj.net/2096f7cc62055.jpg.html
http://zapodaj.net/cf7233054f2fc.jpg.html
其中textView1在你的XML? – yrazlik 2014-09-24 19:29:47