为什么我的第一个应用程序没有显示在手机上?

问题描述 投票:0回答:1

我正在创建我的第一个hello word应用程序,第一个仅显示一个hello word测试并且可以在我的手机上使用,但是我在第二个应用程序中放了一张图片并运行它,电话显示:该应用程序已停止;我的应用程序完全按照我的意愿在xml设计上看! (我的手机装有android 7,而我使用android 4制作了该应用程序)

我尝试显示的图片具有3096x4128的分辨率,但是当我尝试使用其他分辨率较低的图片时,我不知道这是否只是巧合!我试图更改应用程序的android,但存在相同的问题!] >

<ImageView 
android:layout_width="wrap_content"
    android:layout_height="wrap_content" 
android:scaleType="centerCrop"
android:src="@drawable/hugo" />

<TextView 
android:text="What a Picture!" 
android:textSize="36sp"
android:fontFamily="sans-serif-light"
android:textColor="@android:color/white"
android:padding="20dp"
android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

<TextView 
android:text="By AYMEN " 
android:layout_width="wrap_content"
    android:layout_height="wrap_content"
android:padding="20dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:fontFamily="sans-serif-light"
android:textSize="36sp" />

我正在创建我的第一个hello word应用程序,第一个仅显示一个hello word测试并且可以在我的手机上使用,但是我在第二个应用程序中放了一张图片并运行它,电话显示:该应用程序已停止;我的...

java android android-layout
1个回答
0
投票

您必须使用的图像大小小于2MB。这是停止应用程序的主要原因。因此,尝试调整大小,然后在[


0
投票

我认为您收到内存不足错误。为了避免这种情况,您可以使用Picasso或Glide库

© www.soinside.com 2019 - 2024. All rights reserved.