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

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 😛

Leave a Comment