在初始屏幕上包含文本 Android
Include text on the splash screen Android
我正在使用这个网站上流行的方法来制作启动画面:
Splash Screens the Right Way.
我想显示翻译成不同语言的文本 "loading"。之前在评论区有人问过这个问题,作者回复了,但是我不知道怎么按他说的去做。这是他的回复:https://www.bignerdranch.com/blog/splash-screens-the-right-way/#comment-2633426495
如何在屏幕上绘制文字? (如果可能的话)或者正如它在那里所说的那样,How to "include" it in the drawable?
是否有其他方法更可取?
Here is my splash activity xml
This is an easy solution and places the text bellow the image.
<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="fill_parent"
android:background="@color/colorIcons"
tools:context=".SplashActivity">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerVertical="true"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/splashImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="30dp"
android:gravity="center_horizontal"
android:scaleType="fitCenter"
android:src="@mipmap/ic_launcher">
</ImageView>
<TextView
android:id="@+id/splashText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/app_name"
android:textColor="@color/colorPrimary_text"
android:textSize="36sp" />
</LinearLayout>
我正在使用这个网站上流行的方法来制作启动画面: Splash Screens the Right Way.
我想显示翻译成不同语言的文本 "loading"。之前在评论区有人问过这个问题,作者回复了,但是我不知道怎么按他说的去做。这是他的回复:https://www.bignerdranch.com/blog/splash-screens-the-right-way/#comment-2633426495
如何在屏幕上绘制文字? (如果可能的话)或者正如它在那里所说的那样,How to "include" it in the drawable?
是否有其他方法更可取?
Here is my splash activity xml
This is an easy solution and places the text bellow the image.
<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="fill_parent"
android:background="@color/colorIcons"
tools:context=".SplashActivity">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerVertical="true"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/splashImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="30dp"
android:gravity="center_horizontal"
android:scaleType="fitCenter"
android:src="@mipmap/ic_launcher">
</ImageView>
<TextView
android:id="@+id/splashText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/app_name"
android:textColor="@color/colorPrimary_text"
android:textSize="36sp" />
</LinearLayout>