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%给一个:)