У меня возникла такая проблема, что при запуске приложения я получаю нежелательное пустое место сверху и снизу.android ImageView adjustViewBounds не работает. Пробел
Я попытался использовать adjustViewBounds и различные типы шкал, я хочу, чтобы мои фотографии были такими, какие они есть, но просто удалите пробелы.
Imageviews меняет изображение src в моем java-коде, где я загружаю фотографии в действие телефона, а затем устанавливаю изображение в загруженное растровое изображение.
Вот изображение того, как это выглядит на моем эмуляторе, есть один полный экран пробелов, пока вы не перейдете к следующему imageView, прокручивая ScrollView.
Здесь вы можете увидеть мой код XML. TouchImageView - это просто масштабируемый тип imageView.
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fadingEdge="none"
android:fillViewport="true" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/tVInformation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="TextView"
android:visibility="gone" />
<com.fluffow.csgosmokes.TouchImageView
android:id="@+id/iVsmoke1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/ic_launcher" />
<com.fluffow.csgosmokes.TouchImageView
android:id="@+id/iVsmoke2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/ic_launcher" />
<com.fluffow.csgosmokes.TouchImageView
android:id="@+id/iVsmoke3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/ic_launcher" />
<com.fluffow.csgosmokes.TouchImageView
android:id="@+id/iVsmoke4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/ic_launcher"
android:visibility="invisible" />
</LinearLayout>
</RelativeLayout>
Интересным является тот факт, что каждый ImageView получил ровно один андроид симулятор экрана «пробел» между собой, и что если я цвет один imageviews-фон половину пробельных будет этот цвет , следующая половина из следующего изображения. Он получил такое же количество пробелов до и после изображения.
Это ничего не изменило. Пустое пространство все еще там, – fluffow