android – ImageView正在横向模式中展开

android – ImageView正在横向模式中展开,第1张

概述我想在横向模式下保持我的 Imageview的宽高比.即使我使用scaleType,它也看起来超拉伸:fitXY和adjustBounds这是我的xml文件 <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:l 我想在横向模式下保持我的 ImagevIEw的宽高比.即使我使用scaleType,它也看起来超拉伸:fitXY和adjustBounds这是我的xml文件

<?xml version="1.0" enCoding="utf-8"?><linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"androID:layout_wIDth="match_parent"androID:layout_height="match_parent"androID:orIEntation="vertical"><FrameLayout    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent"    androID:padding="24dp"    androID:layout_gravity="center">    <ImageVIEw        androID:layout_wIDth="match_parent"        androID:layout_height="wrap_content"        androID:layout_gravity="center_horizontal"        androID:scaleType="fitXY"        androID:adjustVIEwBounds="true"        androID:ID="@+ID/image" />        />   </FrameLayout> </linearLayout>

更新:
我使用滑行来设置我的imagevIEw.它主要是640 X 330图像

GlIDe.with(this)            .load("http://www.web-cars.com/lambo_sb/img_3410.jpg")            .into(imageVIEw);
解决方法 试试这个,

<?xml version="1.0" enCoding="utf-8"?>    <linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent"        androID:orIEntation="vertical">        <FrameLayout            androID:layout_wIDth="match_parent"            androID:layout_height="match_parent"            androID:layout_gravity="center"            androID:padding="24dp">            <ImageVIEw                androID:ID="@+ID/image"                androID:layout_wIDth="wrap_content"                androID:layout_height="wrap_content"                androID:layout_gravity="center_horizontal"                androID:src="@drawable/placeholder" />            />        </FrameLayout>    </linearLayout>
总结

以上是内存溢出为你收集整理的android – ImageView正在横向模式中展开全部内容,希望文章能够帮你解决android – ImageView正在横向模式中展开所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1123958.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存