XML中的那些属性



android:scaleType
Since: API Level

Controls how the image should be resized or moved to match the size of this ImageView.

Must be one of the following constant values.
Constant Value Description
matrix 0
fitXY 1
fitStart 2
fitCenter 3
fitEnd 4
center 5
centerCrop 6
centerInside 7

This corresponds to the global attribute resource symbol scaleType.
Related Methods

* setScaleType(ImageView.ScaleType)



[color=red]android.weget[/color]
[url]http://androidappdocs.appspot.com/reference/android/widget/ImageView.html#setMaxHeight%28int%29[/url]
public void  setMaxHeight  (int maxHeight)
Since: API Level 1

An optional argument to supply a maximum height for this view. Only valid if setAdjustViewBounds(boolean) has been set to true. To set an image to be a maximum of 100 x 100 while preserving the original aspect ratio, do the following: 1) set adjustViewBounds to true 2) set maxWidth and maxHeight to 100 3) set the height and width layout params to WRAP_CONTENT.

Note that this view could be still smaller than 100 x 100 using this approach if the original image is small. To set an image to a fixed size, specify that size in the layout params and then use setScaleType(ImageView.ScaleType) to determine how to fit the image within the bounds.
Related XML Attributes

* android:maxHeight

Parameters
maxHeight maximum height for this view



[size=medium]距上一个布局的间隔距[/size]离
android:layout_marginTop
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值