我面臨的問題是,我不能將新的圖像按鈕添加到我的XML文件中。我將我的圖標添加到Drawable,但它無法顯示在圖像按鈕中。 XML顯示找不到錯誤的ImageButton類。我該如何解決這個問題?Android Image on Image按鈕不顯示
我在XML以下錯誤
以下類找不到: - 的ImageButton(更改爲android.widget.ImageButton,修復構建路徑,編輯XML)
這裏是我的xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="109dp"
android:src="@drawable/facebook" />
</RelativeLayout>
請上傳你的代碼 – Vigbyor
如果你在xml中使用過選擇器,請確保它的小寫'selector'而不是'Selector'。並確保圖像名稱是正確的。沒有大寫字母或特殊字符。 –
查看我的新編輯,這裏是我的xml – doubter