It would be very useful if the gravity options for ImageViews included the following:
FIT_VERTICAL_LEFT
FIT_VERTICAL_CENTER
FIT_VERTICAL_RIGHT
FIT_HORIZONTAL_TOP
FIT_HORIZONTAL_CENTER
FIT_HORIZONTAL_BOTTOM
For instance, an ImageView is sized at 320 x 240. A bitmap loaded to that view is 220 x 520. In this case, I would use a FIT_VERTICAL option so that image filled the ImageView in height, with the LEFT, CENTER or RIGHT option determining its horizontal position within the ImageView.
By the same token, that same ImageView gets a bitmap with dimensions of 620 x 340. I would use one of the FIT_HORIZONTAL options so that image filled the ImageView in width, with the TOP, CENTER or BOTTOM option determining its vertical position within the ImageView.
FIT_VERTICAL_LEFT
FIT_VERTICAL_CENTER
FIT_VERTICAL_RIGHT
FIT_HORIZONTAL_TOP
FIT_HORIZONTAL_CENTER
FIT_HORIZONTAL_BOTTOM
For instance, an ImageView is sized at 320 x 240. A bitmap loaded to that view is 220 x 520. In this case, I would use a FIT_VERTICAL option so that image filled the ImageView in height, with the LEFT, CENTER or RIGHT option determining its horizontal position within the ImageView.
By the same token, that same ImageView gets a bitmap with dimensions of 620 x 340. I would use one of the FIT_HORIZONTAL options so that image filled the ImageView in width, with the TOP, CENTER or BOTTOM option determining its vertical position within the ImageView.
Last edited: