问题
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?
回答1:
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>
来源:https://stackoverflow.com/questions/51110573/android-how-to-create-splash-screen-with-text