Prepare activity for RelativeLayout

In some of our examples we use RelativeLayout to setup activities or layouts. We do this to make it simpler to start a project and show a sample. If our sample is using RelativeLayout you can use this steps to set it up.

We will prepare our activity for use with RelativeLayout

1. Open Layout Editor for MainActivity. You can read more about Layout Editor on our blog.

Layout Editor

 

2. Just to make it simple for us to add buttons on screen, we will change the ConstraintLayout to RelativeLayout

  • Switch to text modeText Mode
  • Select tag for constraint layout and rename it
    Change Constraint Layout
    Choose Relative Layout
  • Switch to design mode again