从一开始就想要相对布局

时间:2018-12-06 13:13:44

标签: android layout

Android Studio中的新手。最近开始练习基本编码。我想从一开始就具有相对布局或线性布局。尝试过但无法实现。找不到提供的用于选择布局主题的任何选项。自动约束布局启动。请指导。

1 个答案:

答案 0 :(得分:-2)

更改此行:

<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"

<android.widget.RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

并检查您的结束标签更改为:

</android.widget.RelativeLayout>

(可选)继续执行此操作,如果该行显示为灰色,则将其删除:

xmlns:app="http://schemas.android.com/apk/res-auto"

这也是在项目中进行的可选更改,

如果项目中不需要约束布局,请删除该行,然后执行gradle sync,从build.gradle中删除以下依赖项:

compile 'com.android.support.constraint:constraint-layout:......'