java Android-如何保持图像';它的实际尺寸是多少?

java Android-如何保持图像';它的实际尺寸是多少?,java,android,parameters,android-imageview,Java,Android,Parameters,Android Imageview,我完全不知道如何保持图像的实际大小 例如,我有一个名为bottom_tile.png的png,如果我按原样将它放在布局上,它只有一个大小。如果我制作如下平铺位图: <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/ver_bottom_panel_tile" android:tileMode="repeat" androi

我完全不知道如何保持图像的实际大小

例如,我有一个名为bottom_tile.png的png,如果我按原样将它放在布局上,它只有一个大小。如果我制作如下平铺位图:

<bitmap xmlns:android="http://schemas.android.com/apk/res/android" 

  android:src="@drawable/ver_bottom_panel_tile"
        android:tileMode="repeat"
        android:dither="true"

/>    

把它放在我的布局上,它的高度会有所不同,尽管它只有一个瓷砖高,所以它们应该是精确的高度!为什么会这样?两种情况都是:layout\u height=“wrap\u content”

当我设置另一个png文件时,它应该贴在顶部,从左到右拉伸,并设置为android:layout\u height=“wrap\u content”,高度也会扭曲,所以我无法将所有设计都放进去。发生什么事了

我只需要我的实际尺寸,不多不少

我已经被要求布局-它只是2个图像,1是一个瓷砖,第二是什么在上面的代码 位图比平铺大40%+

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"

    tools:context=".MainActivity" >

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

    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/imageView1"
        android:src="@drawable/ver_bottom_panel" />

</RelativeLayout>

你能更具体地说明你在找什么吗?
如果您需要图像达到可以使用的最小高度或原始高度

android:layout\u height=“wrap\u content”

这将使您的图像达到最小高度或原始高度

android:layout\u width=“fill\u parent”


将使图像从左向右或按宽度拉伸。

通过重复位图自动平铺可绘制比例,除非在可绘制文件中指定高度/宽度。它不会垂直重复平铺,我在第一条消息中指定了它,我说位图有一个平铺高。平铺的高度正好是89像素,但是当我把它放在重复模式下时,图片本身会变得更大。
tileMode
只适用于
background
,而不是
src
,我知道,我把它放在了background to layout上。图像本身大小不同,大约大40%。那么,也许你应该发布你的布局。这将避免您在这里看到的所有混乱。我指定使用android:layout\u height=“wrap\u content”,我在第一条消息中写道。