Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/186.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 启动屏幕上的图像未显示_Android_Xml - Fatal编程技术网

Android 启动屏幕上的图像未显示

Android 启动屏幕上的图像未显示,android,xml,Android,Xml,我在闪屏上添加了我的应用程序徽标,但由于某些原因,只有在物理设备或模拟器上运行应用程序时,图像才会显示,在设计预览中显示正确。另外,我尝试将可见性更改为可见,但仍然无法工作 活动\u splash.xml: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://

我在闪屏上添加了我的应用程序徽标,但由于某些原因,只有在物理设备或模拟器上运行应用程序时,图像才会显示,在设计预览中显示正确。另外,我尝试将
可见性
更改为
可见
,但仍然无法工作

活动\u splash.xml:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/background"
    app:layoutDescription="@xml/activity_splash_scene"
    tools:context=".SplashActivity">

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="match_parent"
        android:layout_height="426dp"
        android:visibility="visible"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.448"
        app:srcCompat="@drawable/app_logo" />

    <TextView
        android:id="@+id/textView9"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/app_name"
        android:textColor="@color/white"
        android:textSize="30sp"
        android:textStyle="bold"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/imageView"
        app:layout_constraintVertical_bias="0.73" />

    <TextView
        android:id="@+id/textView10"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="7dp"
        android:layout_marginBottom="16dp"
        android:text="by george sepetadelis"
        android:textColor="@color/white"
        android:textSize="17sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textView9" />

    <ProgressBar
        android:id="@+id/progressBar3"
        style="?android:attr/progressBarStyle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="11dp"
        app:layout_constraintBottom_toTopOf="@+id/textView9"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.498"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.99" />

</androidx.constraintlayout.widget.ConstraintLayout>

嗯,我对xml布局不太了解

尝试改变

app:srcCompat=“@drawable/app_logo”

与:

android:src=“@drawable/app_logo”


它给了我一个错误,不起作用:-)是有意义的,因为活动是兼容的…嗯,我可以看到你在版面预览中遇到了问题,对吗?尝试使用CTRL+E并查看版面检查器。我忘了问,你仍然有问题吗?