android开发布局文件imageview 图片等比例缩放:
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 图片等比例缩放:的更多相关文章
- Android imageView图片按比例缩放
android:scaleType可控制图片的缩放方式,示例代码如下: <ImageView android:id="@+id/img" android:src=" ...
- Imageview 图片按比例缩放
只需要在 布局文件中 加入 android:adjustViewBounds="true"这行代码即可 它会让图片进行等比例的拉伸展示
- 【转】微信小程序开发之图片等比例缩放 获取屏幕尺寸图片尺寸 自适应
原文[https://blog.csdn.net/qq_31383345/article/details/53127804] 早上在论坛上看到有人写了关于图片等比例缩放的文章,只是判断了图片宽是否大于 ...
- android中的文件(图片)上传
android中的文件(图片)上传其实没什么复杂的,主要是对 multipart/form-data 协议要有所了解. 关于 multipart/form-data 协议,在 RFC文档中有详细的描述 ...
- 理解CSS3中的background-size(对响应性图片等比例缩放)
理解CSS3中的background-size(对响应性图片等比例缩放) 阅读目录 background-size的基本属性 给图片设置固定的宽度和高度的 固定宽度400px和高度200px-使用ba ...
- css 如何实现图片等比例缩放
在进行布局的时候,很多PM都要求图片等比例缩放,而且要求图片不失真,不变形,但是UI设计好了这个div的宽度又不能随意更改,而后台传过来的图片也不是等比例的图片,这就比较难受了,写成 width: 1 ...
- 微信小程序学习点滴《十二》:图片等比例缩放 获取屏幕尺寸图片尺寸 自适应
原文:http://www.wxapp-union.com/portal.php?mod=view&aid=360 早上在论坛上看到有人写了关于图片等比例缩放的文章,只是判断了图片宽是否大于屏 ...
- css技术之用最高和最宽的限制“max-height和max-width”做图片同比例缩放,达到图片不变形目的,做出批量打印图片功能,页面打印“window.print()”
一.简介 他们是为流而生的,像width/height这种定死的砖头式布局,min-width/max-width就没有存在的意义 ,min-width/max-width一定是自适应布局或流体布局中 ...
- C#图片按比例缩放
C#图片按比例缩放: // 按比例缩放图片 public Image ZoomPicture(Image SourceImage, int TargetWidth, int TargetHeight) ...
随机推荐
- 分享7款非常实用的jQuery/CSS3插件演示和源码
上次我们分享了15款效果很酷的最新jQuery/CSS3特效,非常不错,今天要分享7个非常实用的jQuery/CSS3插件演示和源码,一起来看看. 1.jQuery ajax点击地图显示商家网点分布 ...
- asp.net首页设置
在web.config中设置首页 <configuration> <system.web> <compilation debug="true" tar ...
- Win7“当前用户没有安装Microsoft Office"
故障:在win7 win10系统已安装office2007~但打开word excel应用程序时提示"当前用户没有安装Microsoft Office". 原因:office200 ...
- Android working with Volley
Volley是google官方推出的一个开源网络访问库,在项目中直接使用它,而不需要写一大堆的重复的代码; 项目主页: https://android.googlesource.com/platfor ...
- location.hash属性介绍
location.hash属性介绍 例如URL: http://wwww.a.com/index#rhythmk 通过location.hash 我们将获取到 #rhythmk. 默认浏览器会滚动至i ...
- python 字符串连接
字符串连接 方法1: 用字符串的join方法 a = ['a','b','c','d']content = ''content = ''.join(a)print content 方法2: 用字符串的 ...
- VS-Visual Studio-IIS Express 支持局域网访问
本文转自:http://www.itnose.net/detail/6132793.html 使用Visual Studio开发Web网页的时候有这样的情况:想要在调试模式下让局域网的其他设备进行访问 ...
- 轻量型ORM框架Dapper的使用
在真实的项目开发中,可能有些人比较喜欢写SQL语句,但是对于EF这种ORM框架比较排斥,那么轻量型的Dapper就是一个不错的选择,即让你写sql语句了,有进行了关系对象映射.其实对于EF吧,我说下我 ...
- Understanding G1 GC Logs--转载
原文地址:https://blogs.oracle.com/poonam/entry/understanding_g1_gc_logs Understanding G1 GC Logs By Poon ...
- Robot Framework自动化测试(四)--- 分层思想
谈到Robot Framework 分层的思想,就不得不提“关键字驱动”. 关键字驱动: 通过调用的关键字不同,从而引起测试结果的不同. 在上一节的selenium API 中所介绍的方法其实就是关 ...