<?xml version="1.0" encoding="utf-8"?>
<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="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
>
<TextView
android:id="@+id/text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="第一个textview"
android:textSize="24sp"
android:textColor="#ff0000"
android:gravity="center"
/>
</RelativeLayout>
![](https://images2015.cnblogs.com/blog/899124/201602/899124-20160229124600876-649722582.jpg)