我刚开始创建android应用程序,但我有一个问题更改layout
,每当我创建新的android项目,它给我RelativeLayout
而不是LinearLayout
,(好吧,基本上我是关注书教学,但它并没有教我如何改变它)我假设必须有一个默认设置,以便我可以将Relativelayout
更改为LinearLayout
。更改Android布局从相对线性
<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" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world"
tools:context=".MainActivity" />
</RelativeLayout>
你应该加上'机器人:方向=“垂直”'如果你想用那种方式 - 它默认为'horizontal' – mgarciaisaia 2016-03-17 15:24:20