I am trying to have this image repeated as the background of my splashscreen. This is my splashscreen.xml:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap
android:src="@drawable/ic_background_blue"
android:gravity="center"
android:tileMode="repeat"/>
</item>
<item>
<bitmap
android:gravity="center"
android:src="@drawable/ic_splash_logo"/>
</item>
</layer-list>
but the tile android:tileMode="repeat"
seem to be ignored and the image is stretched to the aspect ratio of the screen.
Edit:
the android:tileMode="repeat"
works for the activity background, but I am trying to archieve this on the splashscreen.
Theandroid:gravity="center"
doesnt seem to make any difference.
The real layout of my activity is irrelevant, since it never gets used I guess. Here the code of my SplashActivity.java:
package de.ranellstudios.creactivity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class SplashActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = new Intent(this, MenuActivity.class);
startActivity(intent);
finish();
}
}
I connected the splashscreen.xml with my SplashActivity by adding a new theme to my styles.xml:
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/splashscreen</item>
</style>
and this
<activity
android:name=".SplashActivity"
android:theme="@style/SplashTheme"
android:screenOrientation="portrait">
to my manifest.
I am just trying to make the image I linked at the top repeat in the background of my splashscreen instead of beeing stretched to the screen size. Any ideas?
-----
Somehow it seems to work now, sorry for the inconvenience and thanks your your help. the code above is now correct.