I have 4 fragments that look like this:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/hg_nahrung"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="de.noahsofie.abnehmen.MainActivity$PlaceholderFragment">
....
</RelativeLayout>
I assigned a background image to each as in android:background="@drawable/hg_nahrung"
, android:background="@drawable/hg_aufnahme"
etc.
What was a quick swipe before is now choppy. But the images are just 720 x 1280(the resolution of my device). How to have background images without horizontal swiping becoming unbearable? Vertical swiping works flawlessly.
Changing png to smaller jpg did not help either.
EDIT: Here is the solution: android background image slows down app