Android控件之ImageView(显示图片的控件)
16lz
2021-01-23
一、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 material design 军火库 控件
- Android控件笔记——在界面中显示图片
- Android 获取控件宽高的3种方法
- Android UI控件详解-CheckBox(多选框)
- Android UI控件详解-Gallery(画廊)
- Android UI控件详解-ImageSwitcher(图片切换器)
- Android 滑动开关控件
- Android 学习之- 单选按钮、复选框、状态开关、时钟控件
- Android 控件之八:AutoCompleteTextView自动完成文本框