Android-studio Project fails to run

时间:2016-07-11 23:26:58

标签: android debugging android-studio

I'm currently working on a project in android studio and as a part of my project I needed to clean it. I followed the proper steps and now my assignment wont load.

I keep getting these errors and I don't know what they mean. Please help!

enter image description here

2 个答案:

答案 0 :(得分:1)

尝试将ImageView定义更改为:

<ImageView
    android:src="@drawable/sundae"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:scaleType="centerCrop"
    android:id="@+id/imageView" />

我不相信标签“layout_centerCrop”存在。

答案 1 :(得分:0)

该错误基本上表示所提到的布局属性未被识别或不存在。在这种情况下,它是layout_centerCrop。请将android:layout_centerCrop="true"替换为android:scaleType="centerCrop"

顺便说一下,我会建议centerInside而不是centerCrop,以便在图像被裁剪出来时没有,并且仍然具有相同的宽高比。 它看起来像这样:

<ImageView
android:src="@drawable/sundae"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:id="@+id/imageView" />