在Android中重新定位文本
如何更改要按需要显示的文本的位置,该文本在图像上高亮显示(蓝色) 代码:在Android中重新定位文本,android,android-layout,textview,Android,Android Layout,Textview,如何更改要按需要显示的文本的位置,该文本在图像上高亮显示(蓝色) 代码: 所以它有点居中,但只是两个文本视图作为一个整体居中,而不是一个位于页面中间 编辑:也可以只加粗“GDPR语句”而不加粗文本的其余部分吗?您可以将这两个AppCompatTextView以垂直方向包装在LinearLayout中,以满足您的需要。FrameLayouthee似乎没用。此外,gravity和layout\u gravity不适用于此类布局。您应该这样做: <LinearLayout and
所以它有点居中,但只是两个文本视图作为一个整体居中,而不是一个位于页面中间
编辑:也可以只加粗“GDPR语句”而不加粗文本的其余部分吗?您可以将这两个
AppCompatTextView
以垂直方向包装在LinearLayout
中,以满足您的需要。FrameLayout
hee似乎没用。此外,gravity
和layout\u gravity
不适用于此类布局。您应该这样做:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<android.support.v7.widget.AppCompatTextView
android:id="@+id/darekeapp_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/darekeapp_info"
android:textSize="18sp"
android:textColor="@android:color/black" />
<android.support.v7.widget.AppCompatTextView
android:id="@+id/gdpr_statement"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/gdpr_statement"
android:textColor="@android:color/black" />
</LinearLayout>
如果要加粗GDPR,应在strings.xml文件中使用GDPRStatement
,如下所示:
<string name="gdpr_statement"><b>GDPRStatement</b> - the rest of your text</string>
GDPRStatement-文本的其余部分
最好的
<string name="gdpr_statement"><b>GDPRStatement</b> - the rest of your text</string>