2016-07-11 442 views
1

我目前正在研究android studio中的項目,並將其作爲我需要清理的項目的一部分。我遵循適當的步驟,現在我的任務不會加載。Android-studio項目無法運行

我不斷收到這些錯誤,我不知道它們是什麼意思。請幫忙!

enter image description here

+0

你可以嘗試刪除安卓layout_centerCrop,看看它是否有臺階生成錯誤。我無法在簡短的Google搜索中找到layout_centerCrop的位置。它是一種自定義佈局,或者您可能缺少SDK。 – ssk

回答

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" /> 
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」 存在的標籤。