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) ...
随机推荐
- HTTP 头部详细解释
HTTP 头部解释 ================================================ Accept 告诉WEB服务器自己接受什么介质类型,*/* 表示任何类型,ty ...
- Duilib技巧:背景图片平铺
贴图的描述 方式有两种 // 1.aaa.jpg // 2.file='aaa.jpg' res='' restype='0' dest='0,0,0,0' source='0,0,0,0 ...
- vxworks下网络编程一:网络字节序问题
inet_addr("192.168.1.1");//返回网络字节序整型ip地址inet_ntoa(saddr);//将包含网络字节序整型ip地址的in_addr对象转换成本地ch ...
- NFC 与 Windows Phone 的那点事儿
说起NFC这个词儿应该已经不陌生了,在我们的生活中有很多使用场景都是使用的这项技术,例如公交卡,门禁,还有银联的闪付卡等等.并且近些年在移动设备上使用的场景也越来越多,例如 对 NFC TAG 的读写 ...
- C++ CompletionPort(完成端口)示例
ECHO客户端 #include <WINSOCK2.H> #include <stdio.h> #define SERVER_ADDRESS "127.0.0.1& ...
- php随机密码函数的实例代码
php随机密码函数的入门例子 时间:2015-12-16 20:42:48来源:网络 导读:php生成随机密码的函数实例,php生成随机密码的函数,生成数字.大小写字母与特殊字符组合的随机密码. ...
- AssetBundle系列——游戏资源打包(二)
本篇接着上一篇.上篇中说到的4步的代码分别如下所示: (1)将资源打包成assetbundle,并放到自定目录下 using UnityEditor; using UnityEngine; using ...
- C# DES加密解密用法
主要用到C#提供的以下三个类:MemoryStream 内存流DESCryptoServiceProvider 加密服务提供者类CryptoStream 讲数据流连接到加密转换的流 下面是简易代码,已 ...
- 搭建windows下filezilla FTP服务器
FTP服务器必不可少,鉴于serv-u越来越冗余繁多的设置,个人还是比较喜欢简单.干净,满足需求即可的东东,所以选择filezilla.更主要的原因是ta是开元免费使用的,虽然免费,功能却齐全,我发现 ...
- 【转载】Debian/Ubuntu常见安装软件错误解决方案
转载自:http://blog.csdn.net/eqera/article/details/6375293 1.错误: Can't find X includes. Please check you ...