基本属性
preview
android:src=”@图像所在文件夹/图像名字”————————-ImageView的内容图像
android:background=”@图像所在文件夹/图像名字”————ImageView的背景图片
android:background=”#xxxxxx”—————————–ImageView的背景颜色
exercise
<!--
src跟background的区别就在于
src无论怎样变换都会保持原来的比例
而background不会
ps:由于这次调用的图像是位于mipmap的ic_launcher,一般情况下,图像是放在
drawable文件夹下的-->
<ImageView
android:id="@+id/imageView3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"
/>
<ImageView
android:id="@+id/imageView4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@mipmap/ic_launcher"
/>