木三136 2021-04-06 10:43 采纳率: 78.9%
浏览 18
已结题

Android studio 的问题

就是我在用ImageView时,在Design界面不显示,用虚拟机打开也会报错,有人知道是怎么回事吗

这是代码

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <ImageView
        android:id="@+id/test7_ImV1"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:layout_weight="1"
        android:scaleType="fitXY"
        android:src="@drawable/cat1"/>
    <ImageView
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <Button
            android:id="@+id/test7_btn1"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="资源图片"
            android:onClick="btn"/>
        <Button
            android:id="@+id/test7_btn2"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="在线图片"
            android:onClick="btn"/>
        <Button
            android:id="@+id/test7_btn3"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="绘制图片"
            android:onClick="btn"/>
    </ImageView>
</LinearLayout>

 这是Design界面

  • 写回答

1条回答 默认 最新

  • 木三136 2021-04-06 10:59
    关注

    知道哪里错了,改用LinearLayout的地方我用成了ImageView

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 2月11日
  • 已采纳回答 2月3日

悬赏问题

  • ¥15 对于这个问题的解释说明
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败
  • ¥20 java在应用程序里获取不到扬声器设备
  • ¥15 echarts动画效果的问题,请帮我添加一个动画。不要机器人回答。