【发布时间】:2019-03-29 09:55:22
【问题描述】:
如何根据需要更改要显示的文本的位置,该位置在图像上突出显示(蓝色)。
代码:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.HomeFragment">
<android.support.v7.widget.AppCompatTextView
android:id="@+id/darekeapp_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:text="@string/darekeapp_info"
android:textSize="18sp"
android:gravity="center"
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:layout_gravity="bottom"
android:layout_marginBottom="50dp"
android:gravity="center"
android:text="@string/gdpr_statement"
android:textColor="@android:color/black" />
</FrameLayout>
所以它有点居中,但只是两个文本视图作为一个整体居中,而不是一个位于页面中间。
编辑:也可以只加粗“GDPR 声明”而不加粗文本的其余部分吗?
【问题讨论】:
标签: android android-layout textview