Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/231.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_Android Imageview - Fatal编程技术网

Android 将图像适配到完成的帧

Android 将图像适配到完成的帧,android,android-imageview,Android,Android Imageview,我正在创建一个图像视图。但我的图像显示在中间,并且底部布局宽度没有减小。这是我的代码:- <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_par

我正在创建一个图像视图。但我的图像显示在中间,并且底部布局宽度没有减小。这是我的代码:-

<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" >

    <it.sephiroth.android.library.imagezoom.GalleryTouch
        android:id="@+id/image"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_above="@+id/textView1"
        android:layout_weight="1" />

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:background="@drawable/bottom"
        android:text="                                     Thank you" />

</RelativeLayout>

您应该使用“填充父对象”来使用图像填充整个屏幕,这里我正在更改您的代码,这可能对您有用-

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
   android:layout_alignParentTop="true"
    android:layout_height="fill_parent"
     >

     <it.sephiroth.android.library.imagezoom.GalleryTouch
         android:id="@+id/image"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent"
         android:layout_above="@+id/textView1"
          />

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:layout_alignParentBottom="true"
        android:background="@drawable/bottom"
        android:text=" THank you" />

    </RelativeLayout>


尝试在XML文件中为
ImageView
使用属性
android:scaleType=“fitXY”

谢谢。这是一件好事。但图像并没有拍摄完整的imageview区域或手机屏幕。这是预定义库“it.sephiroth.android.library.imagezoom.GalleryTouch”造成的问题吗?是的,如果此图像不能正确地与屏幕匹配,因此它与屏幕相关。sephiroth.android.library.imagezoom.GalleryTouch如果使用网格视图,请尝试将网格视图设为1列谢谢,你是正确的。对不起,我不能给你分数,因为我没有给你的最低通过点。谢谢,但如果这个答案对你有帮助的话,你至少可以接受。显示错误消息必须为15。但我现在有6分钟的时间。当我有,我会100%给一个:)