ImageView的src和背景有什么区别 [英] What is the difference between src and background of ImageView

查看:29
本文介绍了ImageView的src和背景有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对将 srcbackground 用于 ImageView 感到困惑.

I am a puzzled about using src or background for an ImageView.

我知道前者是指这个ImageView的内容,后者是指ImageView的背景.

I know the former means the content of this ImageView and the latter means the background of the ImageView.

但是如何决定使用哪一个呢?我看不出有什么区别.

But how to decide which one to use? I don't see the difference.

推荐答案

所有视图都可以带背景图片.

All views can take a background image.

srcImageView 具有附加功能:

The src to an ImageView has additional features:

  • 不同的缩放类型
  • adjustViewBounds 用于设置边界以匹配图像尺寸
  • 一些转换,例如 alpha 设置
  • different scaling types
  • adjustViewBounds for setting bounds to match image dimensions
  • some transformations such as alpha-setting

您可以在文档中找到更多内容.

And more that you may find in the docs.

这篇关于ImageView的src和背景有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆