У меня есть HorizontalScrollView с 2 изображениями.HorizontalScrollView встроен в ScrollView.Мне бы хотелось, чтобы, если картинка была слишком большой (ширины и / или высоты), чтобы уместиться, она будет обрезана до размера ScrollView (не размера экрана).Если он меньше, без изменений.
Мой xml:
<ScrollView android:id="@+id/scrollView"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_below="@id/headerappview"
android:layout_above="@id/bottomBar"
android:background="@color/white">
<HorizontalScrollView android:layout_height="wrap_content"
android:layout_below="@+id/txtAdditionalContent"
android:id="@+id/hscrollview"
android:paddingBottom="22px"
android:layout_gravity="center_horizontal"
android:layout_width="wrap_content">
<LinearLayout android:layout_height="wrap_content"
android:gravity="center_vertical" android:layout_width="wrap_content">
<ImageView android:id="@+id/img2" android:src="@drawable/icon"
android:paddingRight="25px"
android:scaleType="fitXY"
android:adjustViewBounds="true"
android:cropToPadding="true"
android:layout_height="wrap_content"
android:layout_width="wrap_content"></ImageView>
<ImageView android:id="@+id/img3" android:src="@drawable/icon"
android:cropToPadding="true"
android:scaleType="fitXY"
android:adjustViewBounds="true"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
</ImageView>
</LinearLayout>
</HorizontalScrollView>
</ScrollView>
(Извините за мой плохой английский)