How to switch from the default ConstraintLayout to RelativeLayout in Android Studio

Suhaib picture Suhaib · Feb 16, 2017 · Viewed 103.6k times · Source

I have the latest android Studio (2.3 beta 3) and it seems ConstraintLayout is the default when creating a project. How can I make Android Studio use the RelativeLayout as the default layout element for new projects ?

enter image description here

Answer

Well, I saw the answer above and it worked for me too. But, I gave it a shot, and succeded converting my current project to Relative Layout. Do as follows:

At activity_main.xml tab, change it to text. At the top of it, you'll find the following:

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

Just change all before xmlns to RelativeLayout. Doing so will also change the very bottom line where you would find:

</android.support.constraint.ConstraintLayout>

to

</RelativeLayout>

Problem solved! Be happy :P