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. 使用jQuery开发iOS风格的页面导航菜单

    在线演示1 本地下载     申请达人,去除赞助商链接 iOS风格的操作系统和导航方式现在越来越流行,在今天的jQuery教程中,我们将介绍如何生成一个iphone风格的菜单导航. HTML代码 我们 ...

  2. MMO之禅(三)职业能力

    MMO之禅(三)职业能力 --技术九层阶梯 Zephyr 201304 有了精神,我们还需要实际的行动. 到底需要什么能力?自我分析,窃以为为有九层,无所谓高低,因为每一层都需要不断地砥砺,编程,本身 ...

  3. 如何重置CentOS 7的Root密码?设置CentOS 7的Root密码的方法与步骤

  4. ffmpeg中的sws_scale算法性能测试

    经常用到ffmpeg中的sws_scale来进行图像缩放和格式转换,该函数可以使用各种不同算法来对图像进行处理.以前一直很懒,懒得测试和甄 别应该使用哪种算法,最近的工作时间,很多时候需要等待别人.忙 ...

  5. Win7下使用Telnet命令

    在调试网络端口是否通畅的时候会经常使用到telnet命令,但是在Windows7系统下这个命令默认是不开启的. 开启Telnet命令的方法: 1.在开始程序里,打开控制面板. 2.在控制面板里,点击“ ...

  6. Maximum Entropy Markov Models for Information Extraction and Segmentation

    1.The use of state-observation transition functions rather than the separate transition and observat ...

  7. Android Material Design控件学习(一)——TabLayout的用法

    前言 Google官方在14年Google I/O上推出了全新的设计语言--Material Design.一并推出了一系列实现Material Design效果的控件库--Android Desig ...

  8. sql like 时间

    and Convert(varchar(),TimeStamp,) like '%2013-09-06 09:46:03%'

  9. 【Android】Activity生命周期(亲测)

    测试手机:Nexus 5   系统:4.4 一.测试 测试代码: package com.example.androidalarm; import android.app.Activity; impo ...

  10. [CS231n-CNN] Convolutional Neural Networks: architectures, convolution / pooling layers

    课程主页:http://cs231n.stanford.edu/     参考: 细说卷积神经网络:http://blog.csdn.net/han_xiaoyang/article/details/ ...