实现效果图:
(1)在activity_main.xml里面添加图片控件
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="@mipmap/fengjing" android:id="@+id/hairIv" android:scaleType="matrix"/> </LinearLayout>
(