<LinearLayout 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" android:paddingLeft="@dimen/activity_horizontal_margin"
android:orientation="vertical"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"
android:id="@+id/hh">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="https://bbs.csdn.net/topics/@drawable/myphoto"
android:id="@+id/imageView"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="姓名:李林穎"
android:id="@+id/NametextView"
android:layout_marginBottom="3dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="專業:物聯網工程"
android:id="@+id/SubjecttextView"
android:layout_marginTop="35dp"
android:layout_alignTop="@+id/NametextView"
android:layout_centerHorizontal="true"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="學號:201730134050"
android:id="@+id/IDtextView"
android:layout_below="@+id/SubjecttextView"
android:layout_centerHorizontal="true"
android:layout_marginTop="31dp"
/>
</LinearLayout>
代碼如上,錯誤是Error:(16, 22) No resource found that matches the given name (at 'src' with value '@drawable/myphoto').
圖片加進去可以在界面顯示,只是在生成apk的時候產生這樣的錯誤,圖片是裝在drawable檔案下的
uj5u.com熱心網友回復:
你在drawable目錄下放一張名字為myphoto的圖片呀uj5u.com熱心網友回復:
我放了的,但是不行,不過我把圖片放到mipmap里再改名字就可以了轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/111321.html
標籤:Android
