Android控件之ImageView(显示图片的控件)
16lz
2021-12-04
一、ImageView属性:
android:src = "@drawable/ic_launcher"——ImageView的内容图像(可以和android:background = "#00000"同时使用)
android:background = "@drawable/ic_launcher"——ImageView的背景图像
android:background = "#00000"——ImageView的RGB颜色
二、布局文件中设置ImageView控件
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <ImageView android:id="@+id/imageView1" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#f0f0f0" android:src="@drawable/ic_launcher" /> <ImageView android:id="@+id/imageView2" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/ic_launcher" /> <ImageView android:id="@+id/imageView3" android:layout_width="match_parent" android:layout_height="20dp" android:background="#f0f0f0" /></LinearLayout>
更多相关文章
- android中TextView和EditText控件一些属性
- RelativeLayout用到的一些重要的属性
- Android显示图片自适应(控件+网页)
- android toast 和checkbox and radiogroup的使用
- 修改android默认时区语言
- android material design 军火库 控件
- android ImageView scaleType属性
- 如果Imageview与Linearlayout有叠加且可选资源长度不同,如何布局?
- Android控件笔记——在界面中显示图片