I have a ListView with custom elements defined in relativeLayout, which includes an imageView with android:layout_width="match_parent"and android:layout_height="wrap_content"and a custom vector that can be used as a source, which looks like this:
+-------------------------------------------+
+ solid area | some picture +
+-------------------------------------------+
The problem is that when I switch to landscape mode, the image becomes scaled (to handle the parent width), but at the same time maintaining the aspect ratio, the height increases.
Ideally, I would like to define a Content Inset (as I know it is from iOS), so that the solid area above is stretched to fit the new width, and the "some picture" area is supported with the same aspect ratio. In general, the scaling will happen this way, that the height of the image (and therefore the entire listView element) will be preserved.
Faser source
share