您的位置:首页 > 移动开发 > Android开发

Android开发-ImageViewDemo-AndroidStudio

2016-10-26 15:11 375 查看




<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content" >

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

<RelativeLayout
android:layout_width="match_parent"
android:background="#ffff"
android:layout_height="100dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="100dp"
android:src="@mipmap/ic_launcher"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="无属性" />
</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
android:background="#8888"
android:layout_height="100dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="100dp"
android:scaleType="center"
android:src="@mipmap/ic_launcher"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="scaleType=center" />
</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
android:background="#ffff"
android:layout_height="100dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="100dp"
android:scaleType="centerCrop"
android:src="@mipmap/ic_launcher"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="scaleType=centerCrop" />
</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
android:background="#8888"
android:layout_height="100dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="100dp"
android:scaleType="centerInside"
android:src="@mipmap/ic_launcher"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="scaleType=centerInside" />
</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
android:background="#ffff"
android:layout_height="100dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="100dp"
android:scaleType="fitCenter"
android:src="@mipmap/ic_launcher"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="scaleType=fitCenter" />
</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
android:background="#8888"
android:layout_height="100dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="100dp"
android:scaleType="fitStart"
android:src="@mipmap/ic_launcher"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="scaleType=fitStart" />
</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
android:background="#ffff"
android:layout_height="100dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="100dp"
android:scaleType="fitEnd"
android:src="@mipmap/ic_launcher"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="scaleType=fitEnd" />
</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
android:background="#8888"
android:layout_height="100dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="100dp"
android:scaleType="fitXY"
android:src="@mipmap/ic_launcher"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="scaleType=fitXY" />
</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
android:background="#ffff"
android:layout_height="100dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="100dp"
android:tint="#FF00FF"
android:src="@mipmap/ic_launcher"/>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="tint=#FF00FF" />
</RelativeLayout>

</LinearLayout>
</ScrollView>
</LinearLayout>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: