Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: how to create splash screen with text

How can I add some text to splash screen? My splash screen isn't a separate activity and I don't want to make it as standard activity.

I created it by following this article: https://android.jlelse.eu/launch-screen-in-android-the-right-way-aca7e8c31f52

Is it possible to add some text?

like image 696
z17 Avatar asked Jun 29 '18 23:06

z17


1 Answers

You can create a new layout for your splash screen. But if you still don't want to create it then there is a nasty hack to achieve it.

Open Paint write your text and save the file as png image

Import png file in drawables and add it in <layer-list> as an item below or above your logo/icon

<item android:bottom="50dp"> set position as you want

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:opacity="opaque">
    <item android:drawable="@color/colorPrimary"/>
    <item>
        <bitmap
            android:gravity="center"
            android:src="@drawable/icon"/>
    </item>
    <item android:bottom="50dp">
        <bitmap
            android:gravity="center"
            android:src="@drawable/myTextImage"/>
    </item>
</layer-list>
like image 77
UsamaAmjad Avatar answered Sep 26 '22 03:09

UsamaAmjad