繁体   English   中英

如何删除图像顶部和底部的多余空间

[英]How to Remove extra spaces from Top and Bottom of Image

如何删除图像顶部和底部的多余空间,请参见以下屏幕截图:

在此处输入图片说明

<ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:contentDescription="@string/About"
        android:src="@drawable/menu" />

似乎您需要使用以下android:adjustViewBounds =“ true”。请尝试以下操作:

<ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:contentDescription="@string/About"
        android:src="@drawable/menu"
        android:adjustViewBounds="true" />

您可以将其用作图像视图。

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:contentDescription="@string/About"
    android:src="@drawable/menu"
     />

尝试这种方式:

            <ImageButton
                android:id="@+id/imgbtn_menu"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"

                android:background="@android:color/transparent"
                android:src="@drawable/menu" />

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM