Android_ImageView
2016-06-04 11:08
477 查看
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="com.example.imageview.MainActivity" > <!-- android:src:图片源 android:scaleType center:取图片中间部分 fitCenter:放大缩小到合适的大小 --> <ImageView android:layout_width="160dp" android:layout_height="200dp" android:scaleType="center" android:src="@drawable/background"/> <ImageView android:layout_width="160dp" android:layout_height="200dp" android:scaleType="fitCenter" android:src="@drawable/background"/> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" > <!-- adjustViewBounds: 自动调整视图的边界到合适的值--> <ImageView android:id="@+id/image" android:layout_width="wrap_content" android:layout_height="match_parent" android:src="@drawable/background" android:adjustViewBounds="true" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/image" android:text="button"/> </RelativeLayout> </LinearLayout>
相关文章推荐
- AndroidManifest.xml配置文件的介绍三:权限篇
- 【android学习】EditText输入监听,小写字母自动转换为大写字母
- Android FoldingLayout 折叠布局 原理及实现(二)
- AndroidManifest.xml配置文件的介绍二
- OpenglES2.0 for Android:来画个圆吧
- Android中注解详解,通过注解代替findViewById方法
- 如何学习android开发
- [Android]Uri、UriMatcher、ContentUris详解
- Android Context 是什么?
- AndroidManifest.xml清单配置文件的相关介绍一
- 根据时间按年、月、日、分组、排序
- Service小结
- Android获取屏幕尺寸的4种方法
- Android Studio 如何打JAR包,,怎么 提取 .arr文件:
- Android_RadioButton,CheckBox
- Android activity属性汇总
- Android自定义RatingBar(评分控件)
- Android布局控件之LinearLayout详解
- Android_EditText
- Android控件属性 (TextView 、EditText )