-
打开发现,它的布局就是RelativeLayout,如图:
-
接下来就是用下面的代码,代码:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width=<#if buildApi lt 8 >"fill_parent"<#else>"fill_parent"</#if>
android:layout_height=<#if buildApi lt 8 >"fill_parent"<#else>"fill_parent"</#if> >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world"
tools:context=".${activityClass}" />
</LinearLayout>
,替换,就好了,如图;
-
现在新建一个空白程序,如图:
-
查看它的layout文件夹下的代码,如图:
-
是不是变成了linearlayout,以后就不用担心了,如图:
-
新建安卓项目时根节点是LinearLayout的设置方法
最新推荐文章于 2024-03-22 11:50:19 发布