我剛開始創建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