我的代码和老师一样,却没有图标而且报错。图标问题后面会讲吗?

我的代码和老师一样,却没有图标而且报错。图标问题后面会讲吗?

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:orientation="vertical"    android:layout_width="match_parent"    android:layout_height="match_parent">        <LinearLayout        android:layout_width="match_parent"        android:layout_height="0dp"        android:orientation="horizontal"        android:background="#ff0000"        android:layout_weight="2"        >        <RelativeLayout            android:layout_width="0dp"            android:layout_height="match_parent"            android:layout_weight="2"            android:background="#ff0000">            <ImageView                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:src="@mipmap/ic_launcher_round"></ImageView>        </RelativeLayout>        <LinearLayout            android:layout_width="0dp"            android:layout_height="match_parent"            android:layout_weight="1"            android:orientation="vertical">            <RelativeLayout                android:layout_width="match_parent"                android:layout_height="0dp"                android:layout_weight="1"                android:background="#ffff00">                <ImageView                    android:layout_width="wrap_content"                    android:layout_height="wrap_content"                    android:src="@mipmap/icon_imax2d"></ImageView>            </RelativeLayout>            <RelativeLayout                android:layout_width="match_parent"                android:layout_height="0dp"                android:layout_weight="1"                android:background="#f000">            </RelativeLayout>        </LinearLayout>            </LinearLayout>    <LinearLayout        android:layout_width="match_parent"        android:layout_height="0dp"        android:orientation="horizontal"        android:background="#fff000"        android:layout_weight="1"        >        <RelativeLayout            android:layout_width="0dp"            android:layout_height="match_parent"            android:layout_weight="1"            android:background="#00ffff"></RelativeLayout>        <RelativeLayout            android:layout_width="0dp"            android:layout_height="match_parent"            android:layout_weight="1"            android:background="#0000ff"></RelativeLayout>        <RelativeLayout            android:layout_width="0dp"            android:layout_height="match_parent"            android:layout_weight="1"            android:background="#ff00ff"></RelativeLayout>    </LinearLayout></LinearLayout>

正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

2回答
提问者 慕慕7189412 2021-10-25 14:49:17
  • 那就是你图片的问题,你得保证有

    https://img1.sycdn.imooc.com//climg/6176710a093809db03220200.jpg

    这个图片

    2021-10-25 16:55:45
  • 提问者 慕慕7189412 #2

    就是说我的Android里面没有那些图片是吗?如果是这样的话怎么解决呢?

    2021-10-25 17:26:06
  • 好帮手慕雪 回复 提问者 慕慕7189412 #3

    你自己放个小图片就行了,往mipman文件夹中放,drawable中也放一份。图片名叫icon_3d,后缀为png就行。

    2021-10-26 09:47:52
好帮手慕雪 2021-10-25 13:52:45

同学,你好。老师测试的并没有报错。有icon_imax2d图片就行,你排查一下是不是图片的问题。如果还报错,就把报错的地方截图发一下。

  • 提问者 慕慕7189412 #1

    老师,图片我发上面了,可以帮忙看看吗,感谢

    2021-10-25 14:49:53
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师