我正在使用这个网站上流行的方法来制作启动画面: Splash Screens the Right Way .
而且我想显示“正在加载”到不同语言的翻译文本。之前在评论区有人问过这个问题,作者回复了,但是我不知道怎么按他说的去做。这是他的回复:https://www.bignerdranch.com/blog/splash-screens-the-right-way/#comment-2633426495
如何在屏幕上绘制文本? (如果可能的话)或者正如它在那里所说的那样,如何将它“包含”在可绘制对象中?
另一种方法更可取吗?
最佳答案
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>
关于java - 在启动画面 Android 上包含文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44447512/