我对XML中的TextView存在问题。 这是我的XML代码:TextView未在布局中显示
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".frontScreen">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorAccent"
android:gravity="center"
android:orientation="horizontal"
android:padding="@dimen/activity_horizontal_margin">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/plan"
android:shadowColor="@color/colorPrimary"
android:textColor="@color/colorPrimary"
android:textSize="30sp"
android:shadowRadius="2"
android:gravity="center_horizontal"
android:shadowDx="1"
android:shadowDy="1"
/>
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/colorAccent"
android:gravity="center"
android:orientation="horizontal"
android:padding="@dimen/activity_horizontal_margin">
<Button
android:id="@+id/plan1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:ignore="ButtonStyle" />
<Button
android:id="@+id/plan2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:ignore="ButtonStyle" />
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
如果我写的TextView是线性布局。然后它与按钮重叠。所以我使用2个布局相对和线性。 当我点击设计TextView的,它看起来像TextView的有,我想确切的空间,但文本消失
请检查下面 –