在启动画面上包含文字Android
问题描述:
我使用此网站上流行的方法制作启动画面: Splash Screens the Right Way。在启动画面上包含文字Android
我想显示翻译文本“加载”到不同的语言。这在评论部分的前面提到过,作者回答说,但我不知道如何去做他所说的话。这是他回复的内容:https://www.bignerdranch.com/blog/splash-screens-the-right-way/#comment-2633426495
如何在屏幕上绘制文字? (如果它是可行的)或者正如它在那里所说的那样,如何将它“包含”在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>
+0
感谢您的回答,我没有意识到我正在尝试做的是一个“加载屏幕”,这是在我上面提到的问题中提到的“启动屏幕”之后出现的,它不能被修改,因为它是在manifest.xml中给出的主题,并在应用程序准备就绪之前加载它。 但是“加载屏幕”可以自定义,因为应用程序已经能够显示活动的内容。 – Chipkat
其simple..just创建带线性或相对..放的ImageView和TextView的布局里面.. – ZeroOne
欢迎SO。请阅读[如何解答](http://stackoverflow.com/help/how-to-answer),并按照指南 那里提供优质的答案。 – thewaywewere