I have two layouts that call “footer.xml”, first one is “login.xml”, and second is “main.xml”
When opening the application, onCreate method sets the content view to login.xml.
After I successfully logged in, the main.xml is loaded(successfully).
Now, here’s the problem.
If the main.xml is set as the context view after the user logged in, the footer does not repeat, instead, it is stretched.
I’m wondering why, because the login.xml and main.xml call the footer.xml the same way.
Any solution about this problem?
By the way, here’s the footer.xml
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/footer"
android:tileMode="repeat" />
This is how I call footer.xml with login.xml and main.xml:
<LinearLayout android:id="@+id/footer"
android:layout_width="fill_parent"
android:layout_height="90dip"
android:background="@layout/footer"
android:layout_alignParentBottom="true">
</LinearLayout>
Edit:
I have observed that when pressing the home button, and resuming the app again fixes the footer.
But closing the app using task manager and opening it again does not repeat the background image.
How to solve this?
Found the solution!
This is my login.xml and main.xml look like:
They are really the same, so they also have the same ID.
My solution was to change the ID of every xml file.
For the login.xml,
and for the main.xml,
By doing this, it solved my problem!
but I don’t know why eclipse does not return errors when compiling having the same IDs on layouts.