create linear layout in android by default when making new app instead of relative

五迷三道 提交于 2020-01-23 12:16:08

问题


why when i create new application in android it made with relative layout instead of linear layout.... how can i create linear layout when i create new app by default instead of relative ?

enter code here
<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"
tools:context="${relativePackage}.${activityClass}" >

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/hello_world" />


回答1:


Ok Follow this steps and you can do it but i am 99% sure only.
Go to res-> layout folder and Right Click on it and you get a sidebar asking for what type of file you want to create
Go to -> Edit File Templates option.

Sidebar>

You will see this dialog opened. You see both options right there inside Other tab These options are LayoutResourceFile.xml and LayoutResourceFile_vertical.xml

Change the ${ROOT_TAG} to LinearLayout in both of these LayoutResourceFile.xml and LayoutResourceFile_vertical.xml and you will always get LinearLayout as parent for future.



来源:https://stackoverflow.com/questions/28225806/create-linear-layout-in-android-by-default-when-making-new-app-instead-of-relati

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!