android:scaleType="fitXY" 详细说明

1、scaleType=“matrix”            保持原图大小、从左上角的点开始,以矩阵形式绘图。

2、scaleType=“fitXY”              将原图进行横方向(即XY方向)的拉伸后绘制的。

3、scaleType=“fitStart”           将原图沿左上角的点(即matrix方式绘图开始的点),按比例缩放原图绘制而成的。

4、scaleType=“fitCenter”        将原图沿上方居中的点(即matrix方式绘图第一行的居中的点),按比例缩放原图绘制而成的。

5、scaleType=“fitEnd”            将原图沿下方居中的点(即matrix方式绘图最后一行的居中的点),按比例缩放原图绘制而成的。

6、scaleType=“Center”          保持原图大小,以原图的几何中心点和ImagView的几何中心点为基准,只绘制ImagView大小的图像。

7、scaleType=“centerCrop”   不保持原图大小,以原图的几何中心点和ImagView的几何中心点为基准,只绘制ImagView大小的图像(以填满
ImagView为目标,对原图进行裁剪)。

8、scaleType=“centerInside”  不保持原图大小,以原图的几何中心点和ImagView的几何中心点为基准,只绘制ImagView大小的图像(以显示
完整图片为目标,对原图进行缩放)。


多谢分享。转载于  http://blog.csdn.net/gassion521/article/details/9214565    , 我只是用于笔记,要看详情还得移步、

<?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context=".Fragment_1"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" app:layout_constraintTop_toTopOf="parent"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/colorAccent" android:gravity="center" android:text="wall美图" android:textColor="@color/black" android:textSize="30dp" /> <ViewFlipper android:id="@+id/banner" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" android:inAnimation="@anim/left_in" android:outAnimation="@anim/right_out"> <ImageView android:id="@+id/banner_1" android:layout_width="match_parent" android:layout_height="213dp" android:scaleType="fitXY" app:srcCompat="@mipmap/lbt_1" /> <ImageView android:id="@+id/banner_2" android:scaleType="fitXY" android:layout_width="match_parent" android:layout_height="match_parent" app:srcCompat="@mipmap/lbt_2" /> <ImageView android:id="@+id/banner_3" android:scaleType="fitXY" android:layout_width="match_parent" android:layout_height="match_parent" app:srcCompat="@mipmap/lbt_3" /> <ImageView android:id="@+id/banner_4" android:scaleType="fitXY" android:layout_width="match_parent" android:layout_height="match_parent" app:srcCompat="@mipmap/lbt_4" /> <ImageView android:id="@+id/banner_5" android:scaleType="fitXY" android:layout_width="match_parent" android:layout_height="match_parent" app:srcCompat="@mipmap/lbt_5" /> </ViewFlipper> <View android:layout_width="match_parent" android:layout_height="1dp" android:background="@color/black"/> </LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout>轮播图不会自动轮播
05-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值