ImageView的属性scaleType,如果等比缩放的话,就使用CenterInside,如果想固定大小的话,就CenterCrop


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f3f3f3"
android:orientation="vertical" > <include layout="@layout/titlebar" /> <View
android:layout_height="1px"
android:layout_width="fill_parent"
android:background="@color/expertlist_divider_color" >
</View> <RelativeLayout
android:id="@+id/rl_product"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
android:focusableInTouchMode="false"
android:focusable="false"
android:clickable="false"
android:background="@color/white"
android:padding="8dp" > <ImageView
android:id="@+id/tv_product"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:scaleType="centerInside"
android:src="@drawable/service_appointment_product" /> <TextView
android:id="@+id/chanpin_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tv_product"
android:layout_marginLeft="15dp"
android:layout_toRightOf="@id/tv_product"
android:text="产品专家"
android:textColor="@color/black"
android:textSize="18sp" /> <ImageView
android:id="@+id/ib_product"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/tv_product"
android:layout_alignParentRight="true"
android:padding="5dp"
android:src="@drawable/service_appointment_video" /> <TextView
android:id="@+id/tv_summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/ib_product"
android:layout_alignLeft="@+id/chanpin_tv"
android:maxLength="16"
android:singleLine="true"
android:text="产品咨询,深度解惑,小白变专家!"
android:textColor="@color/black"
android:textSize="11sp" /> </RelativeLayout> <View
android:layout_height="1px"
android:layout_width="fill_parent"
android:background="@color/expertlist_divider_color" >
</View> <RelativeLayout
android:id="@+id/rl_claims"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
android:focusableInTouchMode="false"
android:focusable="false"
android:clickable="false"
android:background="@color/white"
android:padding="8dp" > <ImageView
android:id="@+id/tv_product1"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:scaleType="centerInside"
android:src="@drawable/service_appointment_claims" /> <TextView
android:id="@+id/hebao_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tv_product1"
android:layout_marginLeft="15dp"
android:layout_toRightOf="@id/tv_product1"
android:text="核保专家"
android:textColor="@color/black"
android:textSize="18sp" /> <ImageView
android:id="@+id/ib_product1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:layout_centerVertical="true"
android:src="@drawable/service_appointment_video"
android:layout_alignParentRight="true"/> <TextView
android:id="@+id/tv_summary1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/ib_product1"
android:layout_alignLeft="@+id/hebao_tv"
android:maxLength="17"
android:singleLine="true"
android:text="体检、生存调查搞不懂,小白不发愁!"
android:textColor="@color/black"
android:textSize="11sp" /> </RelativeLayout> <View
android:layout_height="1px"
android:layout_width="fill_parent"
android:background="@color/expertlist_divider_color" >
</View> <RelativeLayout
android:id="@+id/rl_policy"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
android:focusableInTouchMode="false"
android:focusable="false"
android:clickable="false"
android:background="@color/white"
android:padding="8dp"> <ImageView
android:id="@+id/tv_product2"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:scaleType="centerInside"
android:src="@drawable/service_appointment_policy" /> <TextView
android:id="@+id/lipei_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tv_product2"
android:layout_marginLeft="15dp"
android:layout_toRightOf="@id/tv_product2"
android:text="理赔专家"
android:textColor="@color/black"
android:textSize="18sp" /> <ImageView
android:id="@+id/ib_product2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:layout_centerVertical="true"
android:src="@drawable/service_appointment_video"
android:layout_alignParentRight="true"/> <TextView
android:id="@+id/tv_summary2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/ib_product2"
android:layout_alignLeft="@+id/lipei_tv"
android:maxLength="16"
android:singleLine="true"
android:text="保险事故,索赔资料,赔付问题!"
android:textColor="@color/black"
android:textSize="11sp" /> </RelativeLayout> <View
android:layout_height="1px"
android:layout_width="fill_parent"
android:background="@color/expertlist_divider_color" >
</View> <RelativeLayout
android:id="@+id/rl_attache"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
android:focusableInTouchMode="false"
android:focusable="false"
android:clickable="false"
android:background="@color/white"
android:padding="8dp" > <ImageView
android:id="@+id/tv_product3"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:scaleType="centerInside"
android:src="@drawable/service_appointment_attache" /> <TextView
android:id="@+id/fuwu_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tv_product3"
android:layout_marginLeft="15dp"
android:layout_toRightOf="@id/tv_product3"
android:text="服务专员"
android:textColor="@color/black"
android:textSize="18sp" /> <ImageView
android:id="@+id/ib_product3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:layout_centerVertical="true"
android:src="@drawable/service_appointment_video"
android:layout_alignParentRight="true"/> <TextView
android:id="@+id/tv_summary3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/ib_product3"
android:layout_alignLeft="@+id/fuwu_tv"
android:maxLength="16"
android:singleLine="true"
android:text="红利、生存金、报单复数、保单贷款"
android:textColor="@color/black"
android:textSize="11sp" /> </RelativeLayout> <View
android:layout_height="1px"
android:layout_width="fill_parent"
android:background="@color/expertlist_divider_color" >
</View> </LinearLayout>

android开发布局文件imageview 图片等比例缩放:的更多相关文章

  1. Android imageView图片按比例缩放

    android:scaleType可控制图片的缩放方式,示例代码如下: <ImageView android:id="@+id/img" android:src=" ...

  2. Imageview 图片按比例缩放

    只需要在 布局文件中 加入 android:adjustViewBounds="true"这行代码即可 它会让图片进行等比例的拉伸展示

  3. 【转】微信小程序开发之图片等比例缩放 获取屏幕尺寸图片尺寸 自适应

    原文[https://blog.csdn.net/qq_31383345/article/details/53127804] 早上在论坛上看到有人写了关于图片等比例缩放的文章,只是判断了图片宽是否大于 ...

  4. android中的文件(图片)上传

    android中的文件(图片)上传其实没什么复杂的,主要是对 multipart/form-data 协议要有所了解. 关于 multipart/form-data 协议,在 RFC文档中有详细的描述 ...

  5. 理解CSS3中的background-size(对响应性图片等比例缩放)

    理解CSS3中的background-size(对响应性图片等比例缩放) 阅读目录 background-size的基本属性 给图片设置固定的宽度和高度的 固定宽度400px和高度200px-使用ba ...

  6. css 如何实现图片等比例缩放

    在进行布局的时候,很多PM都要求图片等比例缩放,而且要求图片不失真,不变形,但是UI设计好了这个div的宽度又不能随意更改,而后台传过来的图片也不是等比例的图片,这就比较难受了,写成 width: 1 ...

  7. 微信小程序学习点滴《十二》:图片等比例缩放 获取屏幕尺寸图片尺寸 自适应

    原文:http://www.wxapp-union.com/portal.php?mod=view&aid=360 早上在论坛上看到有人写了关于图片等比例缩放的文章,只是判断了图片宽是否大于屏 ...

  8. css技术之用最高和最宽的限制“max-height和max-width”做图片同比例缩放,达到图片不变形目的,做出批量打印图片功能,页面打印“window.print()”

    一.简介 他们是为流而生的,像width/height这种定死的砖头式布局,min-width/max-width就没有存在的意义 ,min-width/max-width一定是自适应布局或流体布局中 ...

  9. C#图片按比例缩放

    C#图片按比例缩放: // 按比例缩放图片 public Image ZoomPicture(Image SourceImage, int TargetWidth, int TargetHeight) ...

随机推荐

  1. twisted 学习笔记二:创建一个简单TCP客户端

    #coding=utf-8 from twisted.internet import reactor,protocol class QuickClient(protocol.Protocol): de ...

  2. 关于STM8的用户数据空间读写问题

    情况是这样的,我的程序里有一个参数,数值不超过1000,我要保存到EEPROM中,那就要分两个字节存放.我用下面的方式保存是正常的: BASE = 0x4000; param = 999; eepro ...

  3. dlib库使用

    最近的工作中用到了dlib这个库,该库是一个机器学习的开源库,使用起来很方便,直接包含头文件即可,并且不依赖于其他库(自带图像编解码库源码).不过由于是开源的,所以bug多少有一些,我在example ...

  4. 打开 Mac OS X 隐藏的用户资源库文件夹的方法

    在较高版本的 Mac OS X 中,用户的资源库文件夹(/Users/username/Library)默认被系统隐藏了,从 Finder 窗口中不能直接打开. 但是通过下面这个方法可以快速打开用户资 ...

  5. 开发一款高端大气上档次的android应用需要必备的知识——记于2013年末

    Android入门还是很简单的,看两本书,翻阅几篇文章,搭建了开发环境就算入门了.可是怎样开发一款完备的android应用呢,开发一款高端的android应用又需要那些知识呢,作者根据几年的开发经验做 ...

  6. IEEEtran模版中添加中文:\usepackage{CJKutf8}

    \documentclass[conference]{IEEEtran} \usepackage{cite} \usepackage{graphicx} \usepackage{CJKutf8} \b ...

  7. Qt5 从头学(1)-- 环境

    对我来说MFC太过麻烦了,同样是桌面开发工具,Qt就完全不一样了.Qt使用C++语言可以轻松实现"一次编写,到处编译"的跨平台性能,并且可以做出很多炫酷的界面效果.目前支持几乎所有 ...

  8. WINDOWS 2008Server 配置nginx 反向代理服务器

    本案例有用过可行 0.先要在域名官网上面配置域名对应的IP地址,然后要在自己路由器上面将80端口映射到要装nginx服务器的IP地址. 1.从官网上面下载nginx1.6.2   WINDOWS版本的 ...

  9. Cwinux源码解析(一)

    我在我的个人博客发表了新的文章,欢迎各位读者批评指正. Cwinux源码解析(一)

  10. 后端码农谈前端(HTML篇)第一课:HTML概述

    一.什么是HTML? HTML不是编程语言,是用来描述网页文档(页面结构)的一种标记语言: HTML指超文本标记语言(Hyper Text Markup Language),之所以称为超文本标记语言, ...