1.目标效果
在页面中实现四个图片视图,分别是:原始尺寸,调整边距,定义大小(在底部),定义大小(加前景颜色)
其中由于图片太大需要滑动条以实现图片的查看,需要嵌套一个
ScrollView,参考链接
2.页面布局
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="vertical"
android:fadingEdge="vertical">
<LinearLayout
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity"
android:isScrollContainer="true">
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/show"
android:layout_margin="3dp"
android:background="#666666"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/show"
android:layout_margin="3dp"
android:adjustViewBounds="true"
android:background="#666666"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/show"
android:layout_margin="3dp"
android:scaleType="fitEnd"
android:background="#666666"
android:maxWidth="75dp"
android:maxHeight="50dp"/>
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@drawable/show"
android:layout_margin="3dp"
android:tint="#77889900"
android:background="#666666"/>
</LinearLayout>
</ScrollView>