Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/179.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
Java Android ImageView在图像周围添加了空白(此处尝试了修复,但没有运气)_Java_Android_Xml_Imageview - Fatal编程技术网

Java Android ImageView在图像周围添加了空白(此处尝试了修复,但没有运气)

Java Android ImageView在图像周围添加了空白(此处尝试了修复,但没有运气),java,android,xml,imageview,Java,Android,Xml,Imageview,我正在创建一个android启动屏幕,在ImageView中有一个图像 我放在图像视图中的图像是75x75像素,没有任何空白(见下文) 我尝试将背景设置为透明/黑色/删除布局填充,但仍然没有成功 我正在使用的图像: 活动\u start\u screen.xml的xml文件结果 这是我目前正在讨论的屏幕的xml,我会Java,但第一次使用android,所以我还不知道所有的提示和技巧 XML: java文件中还没有代码,我只是在创建布局,或者应该使用java代码进行图像添加/颜色设置 黑

我正在创建一个android启动屏幕,在ImageView中有一个图像

我放在图像视图中的图像是75x75像素,没有任何空白(见下文)

我尝试将背景设置为透明/黑色/删除布局填充,但仍然没有成功

我正在使用的图像:

活动\u start\u screen.xml的xml文件结果

这是我目前正在讨论的屏幕的xml,我会Java,但第一次使用android,所以我还不知道所有的提示和技巧

XML:


java文件中还没有代码,我只是在创建布局,或者应该使用java代码进行图像添加/颜色设置


黑色设置为#000000,因此它确实是黑色的

您需要使用
.png
图像,而不是其他格式。

我觉得很愚蠢,原来是.png,导出时我忘了另存为png。谢谢
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/startScreenRelLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/black"
    tools:context=".StartScreen" >

    <Button
        android:id="@+id/startCreateWalkButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_centerHorizontal="true"
        android:layout_below="@+id/logoImageView"
        android:text="@string/startCreateButtonText" />

    <Button
        android:id="@+id/startEditWalkButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/startCreateWalkButton"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="@string/startEditButtonText" />

    <ImageView
        android:id="@+id/logoImageView"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="114dp"
        android:adjustViewBounds="false"
        android:background="@color/black"
        android:contentDescription="@string/logoText"
        android:src="@drawable/logo" />

</RelativeLayout>