Android_ImageView
<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>
Android_ImageView的更多相关文章
- android关于图片缩放
网上有许多关于图片缩放的demo,本人都感觉不怎么好用,最近在github看到了 一个简单的支持多指缩放图片的Android View类 gesture-imageview (地址:https://g ...
随机推荐
- Android开发UI之补间动画-布局添加动画
布局添加动画 使用步骤: 1.获取到布局的id RelativeLayout ly=(RelativeLayout)findViewById(R.id.layout); 2.设置动画样式 ScaleA ...
- BZOJ3166: [Heoi2013]Alo
3166: [Heoi2013]Alo Time Limit: 20 Sec Memory Limit: 256 MBSubmit: 394 Solved: 204[Submit][Status] ...
- -_-#【减少 DOM 访问】缓存已经访问过的元素
Minimize DOM Access Cache references to accessed elements 选择器查询是开销很大的方法.所以,使用选择器的次数应该越少越好,并且尽可能缓存选中的 ...
- Linux下归档与压缩工具笔记
tar具体使用笔记 归档工具 tar 语法 功能 选项 常见搭配 压缩工具 bzip2 工具 使用方法 gzip 工具 zip 工具 归档工具 tar tar是一个开源的Linux/Unix中最广泛使 ...
- winhex的使用
1. 当我们用VC编写代码,将数据写入到磁盘的文件后,用winhex查看,winhex可以检测文件最后写入时间的变动,如果有变动,则会提示“此文件的最后写入时间已经改变.解除当前状态并重新载入吗?”, ...
- 【转】“/usr/bin/ld: cannot find -lz”
原文网址:http://stackoverflow.com/questions/3373995/usr-bin-ld-cannot-find-lz I am trying to compile And ...
- 如何在小方框上打对号 小方框内打对勾 word 方框打对勾
在word中做选择时,很多人遇到需要在小方框上打对勾而不知如何做,现将可行的各种方法总结如下: 1:直接找到一个做好的,保存为图片,在需要的时候插入它: 2:插入文本框,然后边框选择为实线,在文本 ...
- [Irving]SQL去重复-DISTINCT用法
在表中,可能会包含重复值.这并不成问题,不过,有时您也许希望仅仅列出不同(distinct)的值.关键词 distinct用于返回唯一不同的值. 表A: 示例1 select distinct nam ...
- 数据挖掘R与SQL
本文在Creative Commons许可证下发布 对于数据挖掘专业网站 KDnuggets网站的Poll持保留态度,但它的结果毕竟代表了某一类人群的使用偏好,尤其是在语言角度. 我们看排名前5位的语 ...
- wuzhicms后台菜单的添加
红色部分都是从菜单管理处添加而来.只有少数是自定义的. 开发一个模块,首先就是菜单的管理.而,不需要的功能也可以在在菜单管理处隐藏或删除. 添加菜单: