<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的更多相关文章

  1. android关于图片缩放

    网上有许多关于图片缩放的demo,本人都感觉不怎么好用,最近在github看到了 一个简单的支持多指缩放图片的Android View类 gesture-imageview (地址:https://g ...

随机推荐

  1. lib 合并

    方法1: 命令如下:lib.exe lib1.lib lib2.lib ... /out:hw.lib 另一种合并的方法: 思路:lib.exe 可以把lib文件里的obj文件取出来,然后把这些obj ...

  2. 更换手机号或者更换手机后QQ设备锁的设置问题

    更换手机号 一步到位,更改密保手机号,OK了 更换手机 老卡插入 登录QQ,OK了 更换手机号和手机 老卡插入新手机 登录QQ 新卡插入新手机 更改密保手机号,OK了

  3. xfce terminal tab被解释为super+tab的bug

    https://bugzilla.xfce.org/show_bug.cgi?id=10760 解决方法 Every few weeks the tab key stops working in th ...

  4. -_-#【CSS 优化】

    高性能CSS 关于css通配符性能问题不完全测试 CSS的渲染效率 border: none; /* 不写 border: 0; 但几乎都是写 border: 0;的.. */ 不要使用过小的图片做背 ...

  5. SharePoint Services 数据库表

    转:http://dugan.bokee.com/630446.html 以下是Microsoft Windows SharePoint Services架构中数据库列表. Configuration ...

  6. lightoj 1013

    思路:动态规划.设dp[i][j][k]表示用第一个串的前i隔字符和第二个串的前k隔字符组成长度为i的串的个数,那么:若s1[j+1] == s2[k+1] dp[i+1][j+1][k+1] += ...

  7. Soap UI 数据库脚本(转)

    3:在SoapUI的Test Case中新建Groovy Script连接数据库 接口如下 def sql = Sql.newInstance( 地址, 用户名, 密码, 驱动 ) 实现样例如下: i ...

  8. sunlime操作

    ctrl+p 查找文件  @进行符号查找ctrl+h 替换文件 选中字符以后多次按 ctrl+D 跳过则按 ctrl+Kctrl+shift+d 复制多行alt+f3 多选 ctrl+shift+p ...

  9. cocos2d-x 从onEnter、onExit、 引用计数 谈内存泄露问题

    /////////////////////////////////// //author : zhxfl //date   : 2013.8.29 //email  : 291221622@qq.co ...

  10. java.lang.RuntimeException: java.lang.ClassNotFoundException: cmd.CmdWordCount$MyMapper解决方法

    14/02/28 20:29:48 INFO mapred.JobClient: Task Id : attempt_201402281833_0004_m_000000_1, Status : FA ...