<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. Android开发UI之Toast的使用

    Toast,A toast provides simple feedback about an operation in a small popup. 对于操作提供一个简单反馈信息. 官网链接:htt ...

  2. iPhone丢失后通过iccid找回流程

    切记,丢失IPHONE第一时间要去补卡,免得小偷刷机用你的卡激活,这样你查到的号码只会是你自己的号码找iphone有2个方法:ICCID和维修换机.两者之间没任何直接联系,请不要混淆!下面是总体流程图 ...

  3. ARM-Linux配置DHCP自动获取IP地址

    备注:内核版本:2.6.30.9busybox版本:1.15.2 PC Linux和开发板Linux的工作用户:root 1. 配置内核:[*] Networking support --->N ...

  4. STSdb

    打开数据库并写入数据 ? using (StorageEngine engine = new StorageEngine("stsdb4.sys", "stsdb4.da ...

  5. 提升WI-FI信号强度的10大方法

    原文链接:http://server.51cto.com/Net-402889.htm

  6. 华为2015 简单 字典输入法 java

    题目摘自http://blog.csdn.net/dongyi91/article/details/38639915 写了2个小时,水平太菜了 入法的编码原理为:根据已有编码表,当输入拼音和数字后输出 ...

  7. Extjs 4.x 得到form CheckBox的值

    CheckBox(复选框)主要用来接收用户选择的选项 如图所示(请忽略UI的不好看): 该弹出窗口的主要代码如下: var win = new Ext.Window({ modal : true, t ...

  8. Android 单字阅读

    package com.desmand.screencapture; import android.app.Activity; import android.content.Intent; impor ...

  9. Eclipse创建Maven Web项目 + 测试覆盖率 + 常见问题(2015.07.14——湛耀)

    Eclipse创建Maven web项目: 到此,并没有创建好,接下来一步步解决问题: 问题:无法创建src/main/java目录 解决: 右键项目选择[properties] 点击[OK] 问题: ...

  10. Nyoj42 一笔画问题 (欧拉道路)

    http://acm.nyist.net/JudgeOnline/problem.php?pid=42题目链接 #include <cstdio> #include <cstring ...