AdjustViewBoundsプロパティの使用
Adjustviewbounds Property Use
問題が発生する
- 問題の説明
いつScrollView
大きすぎる画像を含めると、大きな空白が自動的に上に追加されます
- レイアウトファイル
ImageView
-
異常なレンダリング
問題が解決しました
android:adjustViewBounds='true'
属性を追加ImageView
- 変更されたレイアウト
Set this to true if you want the ImageView to adjust its bounds to preserve the aspect ratio of its drawable.
公式文書
google
公式APIアドレス https://developer.android.com/reference/android/widget/ImageView.html
- setAdjustViewBounds 火
- android:adjustViewBounds 火
上記の2つのブロックで1つの文しか話されていないことがわかります
If you want the ImageView to adjust the borders to retain its drawable aspect ratio, set it to true.
setMaxWidth
翻訳の結果は
adjustViewBounds
- setMaxWidth 火
有効 翻訳は 効果的
上の赤いボックスの意味はThe android:adjustViewBounds property of ImageView is whether to maintain the aspect ratio of the original image. Setting it separately does not work. It needs to be used together with maxWidth or maxHeight.
ですこのプロパティはmaxWidth
にのみ存在します属性がtrueの場合に有効です。
- インターネット上に広がる
adjustViewBounds
この文は依存関係を逆転させるはずです。adjustViewBounds
プロパティは依存します
および
個別に設定でき、効果的です。