Skip to content

Instantly share code, notes, and snippets.

@lintianzhi
Last active December 20, 2015 17:49
Show Gist options
  • Save lintianzhi/6171331 to your computer and use it in GitHub Desktop.
Save lintianzhi/6171331 to your computer and use it in GitHub Desktop.
Description of imageView

我们将 mode 看做 3 个 bits,即 mode = X Y Z,其中:

  • X = 0(表示WH - 限定宽高),1(表示LS - 限定长短边)
  • Y = 0(表示LimitOut - 限定图片恰好超出矩形),1(表示LimitIn - 限定图片不能超出矩形)
  • Z = 0(表示NoCrop - 不进行裁剪),1(表示Crop - 进行裁剪,对于 LimitIn 而言无意义)

注意
在含有LS的模式中,参数w表示l,即长边;参数h表示s,即短边

因此得到0到7模式的对应关系

  • 0: 表示 NoCrop + LimitOut + WH
  • 1: 表示 Crop + LimitOut + WH
  • 2: 表示 NoCrop + LimitIn + WH
  • 3: 表示 Crop + LimitIn + WH,此模式无意义
  • 4: 表示 NoCrop + LimitOut + LS
  • 5: 表示 Crop + LimitOut + LS
  • 6: 表示 NoCrop + LimitIn + LS
  • 7: 表示 Crop + LimitIn + LS,此模式无意义

imageView的各个模式对应:

  • imageView/0: 6
  • imageView/1: 1
  • imageView/2: 2
  • imageView/3: 0
  • imageView/4: 4
  • imageView/5: 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment