安卓APP_ 控件(4)—— ImageView
摘自:安卓APP_ 控件(4)—— ImageView
作者:丶PURSUING
发布时间: 2021-03-29 21:52:06
网址:https://blog.csdn.net/weixin_44742824/article/details/115311375
开篇:安卓APP_ 控件(1)—— TestView
ImageView主要是进行图片的缩放控制:
导入图片时,可能要更改图片名才能使用:
.xml
中具体实现代码
<?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:orientation="vertical"><!-- 图片原来就很大,会默认进行等比例缩放scaleType: fitCenter 为缩放后放于中间(默认)fitEnd 缩放后放在右下角fitStart 缩放后放在左上角center 保持图片原图大小,超过ImageView范围部分被裁剪centerCrop 保持宽高等比缩放,直到完全覆盖ImageViewmatrix 从图片的左上角开始绘制,能画多少是多少。如果图片大,就只能看到左上角src: 引用图片资源--> <ImageViewandroid:layout_width="270dp"android:layout_height="423dp"android:scaleType="fitCenter"android:src="@drawable/test1" /><!-- maxWidth/maxHeight/adjustViewBounds的重要用法使得控件ImageView的大小和图片的大小一样,并且为等比例缩放adjustViewBounds 调整view的界限 maxWidth 最大宽度--><ImageViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:adjustViewBounds="true"android:maxWidth="300dp"android:maxHeight="300dp"android:src="@drawable/test2" /></LinearLayout>
安卓APP_ 控件(4)—— ImageView相关推荐
- 安卓APP_ 控件(11)webView —— 简单应用:显示网页
摘自:安卓APP_ 控件(11)webView -- 简单应用:显示网页 作者:丶PURSUING 发布时间: 2021-05-11 11:50:52 网址:https://blog.csdn.net ...
- 安卓APP_ 控件(10)—— ListView可上下滑动的列表(重要)与ViewHolder优化
摘自:安卓APP_ 控件(10)-- ListView可上下滑动的列表(重要)与ViewHolder优化 作者:丶PURSUING 发布时间: 2021-04-12 23:28:27 网址:https ...
- 安卓APP_ 控件(9)—— PopupWindow弹窗
摘自:安卓APP_ 控件(9)-- PopupWindow弹窗 作者:丶PURSUING 发布时间: 2021-04-05 14:41:35 网址:https://blog.csdn.net/weix ...
- 安卓APP_ 控件(8)—— AlertDialog
摘自:安卓APP_ 控件(8)-- AlertDialog 作者:丶PURSUING 发布时间: 2021-04-02 18:13:20 网址:https://blog.csdn.net/weixin ...
- 安卓APP_ 控件(7)——Toolbar栏目样式
摘自:安卓APP_ 控件(7)--Toolbar栏目样式 作者:丶PURSUING 发布时间: 2021-04-02 15:42:07 网址:https://blog.csdn.net/weixin_ ...
- 安卓APP_ 控件(6)—— Notification通知
摘自:安卓APP_ 控件(6)-- Notification通知 作者:丶PURSUING 发布时间: 2021-04-02 00:30:14 网址:https://blog.csdn.net/wei ...
- 安卓APP_ 控件(5)—— ProgressBar
摘自:安卓APP_ 控件(5)-- ProgressBar 作者:丶PURSUING 发布时间: 2021-03-31 13:03:07 网址:https://blog.csdn.net/weixin ...
- 安卓APP_ 控件(3)—— EditText
摘自:安卓APP_ 控件(3)-- EditText 作者:丶PURSUING 发布时间: 2021-03-29 18:43:40 网址:https://blog.csdn.net/weixin_44 ...
- 安卓APP_ 控件(2)—— Button
摘自:安卓APP_ 控件(2)-- Button 作者:丶PURSUING 发布时间: 2021-03-29 14:20:54 网址:https://blog.csdn.net/weixin_4474 ...
最新文章
- 如何在 TensorFlow 中用深度学习修复图像?(附论文)
- hal库开启中断关中断_[STM32]HAL库下GPIO按键中断与去抖问题分析(分析源码解决问题)...
- : Content type 'text/plain;charset=UTF-8' not supported
- ajax请求flask以后得到的响应查看
- css Flex布局(一)
- Linux下磁盘阵列raid
- 【联系】—— Beta 分布与二项分布、共轭分布
- Objective--C Practice and source code
- Windows7安装VC2015-2019_redist.x64提示“设置失败0xc8000222-未指定的错误”
- Reactor | Epoll 模型理解
- 基于matlab的FFT滤波,可以实现对simulink模型中示波器的波形数据或者外部mat数据、csv数据进行谐波分析(FFT)和自定义频段清除
- Redis下载安装-Windows版本
- java pojo类
- 大雪坪剑来 Spring Cloud 教程(二):Spring Boot 集成 mybatis 实现增删改查
- Kafka安全认证 SASL/PLAINTEXT,账号密码认证
- 乐高机器人EV3的PID巡线控制——附源程序
- leetcode387题解
- 帕斯卡命名法、驼峰命名法、下划线命名法
- 详解Unity中的粒子系统Particle System (三)
- Node总结及核心模块fs