How to make a layout like this image using constraint layout










-2















How to make this type of view in Android Studio using constraint layout



enter image description here










share|improve this question




























    -2















    How to make this type of view in Android Studio using constraint layout



    enter image description here










    share|improve this question


























      -2












      -2








      -2








      How to make this type of view in Android Studio using constraint layout



      enter image description here










      share|improve this question
















      How to make this type of view in Android Studio using constraint layout



      enter image description here







      android






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 13 '18 at 16:06









      Makyen

      20.7k84075




      20.7k84075










      asked Nov 13 '18 at 14:41









      MaryamMaryam

      12




      12






















          1 Answer
          1






          active

          oldest

          votes


















          0














          If you're wondering about how to place the menu to fall half on the top view and half on the bottom view, just drag it manually to the position you want to have it, and on the design tab of Android studio select the Magic Wand icon, to "infer constraints". As for the views in the background make sure you add app:layout_constraintBottomToTopOf="yourBottomView" to your view on top and app:layout_constraintTopToBottomOf="yourTopView".



          Check the codelabs tutorial on Constraint Layout here for more info, or the documentation on the developers' website here



          EDIT:



          <?xml version="1.0" encoding="utf-8"?>
          <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent">

          <ImageView
          android:id="@+id/imageView"
          android:layout_width="match_parent"
          android:layout_height="100dp"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          android:layout_marginTop="8dp"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          app:srcCompat="@android:color/holo_blue_bright" />

          <ImageView
          android:id="@+id/imageView2"
          android:layout_width="match_parent"
          android:layout_height="450dp"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/imageView"
          app:srcCompat="@android:color/darker_gray" />

          <android.support.constraint.ConstraintLayout
          android:id="@+id/constraintLayout"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          app:layout_constraintBottom_toBottomOf="@+id/imageView"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/imageView">

          <TextView
          android:id="@+id/textView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView"
          app:layout_constraintEnd_toStartOf="@+id/textView2"
          app:layout_constraintHorizontal_chainStyle="packed"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent" />

          <TextView
          android:id="@+id/textView2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView"
          app:layout_constraintEnd_toStartOf="@+id/textView3"
          app:layout_constraintHorizontal_chainStyle="packed"
          app:layout_constraintStart_toEndOf="@+id/textView"
          app:layout_constraintTop_toTopOf="parent" />

          <TextView
          android:id="@+id/textView3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_chainStyle="packed"
          app:layout_constraintStart_toEndOf="@+id/textView2"
          app:layout_constraintTop_toTopOf="parent" />
          </android.support.constraint.ConstraintLayout>
          </android.support.constraint.ConstraintLayout>


          This is what I get from the above:
          layout






          share|improve this answer

























          • No this rounded view has adjusted ht these three buttons and textviews are not come in center on changing multiple devices.

            – Maryam
            Nov 14 '18 at 7:52











          • @Maryam I would organise the three buttons/textviews into a separate constraint layout within the bigger layout, to make sure you keep the balance, and then constraint that layout as one item, instead of trying to center each of the views

            – Nikos Hidalgo
            Nov 14 '18 at 9:35











          • @Maryam I edited my answer to include some guideline code for the layout

            – Nikos Hidalgo
            Nov 14 '18 at 10:19










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53283455%2fhow-to-make-a-layout-like-this-image-using-constraint-layout%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          If you're wondering about how to place the menu to fall half on the top view and half on the bottom view, just drag it manually to the position you want to have it, and on the design tab of Android studio select the Magic Wand icon, to "infer constraints". As for the views in the background make sure you add app:layout_constraintBottomToTopOf="yourBottomView" to your view on top and app:layout_constraintTopToBottomOf="yourTopView".



          Check the codelabs tutorial on Constraint Layout here for more info, or the documentation on the developers' website here



          EDIT:



          <?xml version="1.0" encoding="utf-8"?>
          <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent">

          <ImageView
          android:id="@+id/imageView"
          android:layout_width="match_parent"
          android:layout_height="100dp"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          android:layout_marginTop="8dp"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          app:srcCompat="@android:color/holo_blue_bright" />

          <ImageView
          android:id="@+id/imageView2"
          android:layout_width="match_parent"
          android:layout_height="450dp"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/imageView"
          app:srcCompat="@android:color/darker_gray" />

          <android.support.constraint.ConstraintLayout
          android:id="@+id/constraintLayout"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          app:layout_constraintBottom_toBottomOf="@+id/imageView"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/imageView">

          <TextView
          android:id="@+id/textView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView"
          app:layout_constraintEnd_toStartOf="@+id/textView2"
          app:layout_constraintHorizontal_chainStyle="packed"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent" />

          <TextView
          android:id="@+id/textView2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView"
          app:layout_constraintEnd_toStartOf="@+id/textView3"
          app:layout_constraintHorizontal_chainStyle="packed"
          app:layout_constraintStart_toEndOf="@+id/textView"
          app:layout_constraintTop_toTopOf="parent" />

          <TextView
          android:id="@+id/textView3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_chainStyle="packed"
          app:layout_constraintStart_toEndOf="@+id/textView2"
          app:layout_constraintTop_toTopOf="parent" />
          </android.support.constraint.ConstraintLayout>
          </android.support.constraint.ConstraintLayout>


          This is what I get from the above:
          layout






          share|improve this answer

























          • No this rounded view has adjusted ht these three buttons and textviews are not come in center on changing multiple devices.

            – Maryam
            Nov 14 '18 at 7:52











          • @Maryam I would organise the three buttons/textviews into a separate constraint layout within the bigger layout, to make sure you keep the balance, and then constraint that layout as one item, instead of trying to center each of the views

            – Nikos Hidalgo
            Nov 14 '18 at 9:35











          • @Maryam I edited my answer to include some guideline code for the layout

            – Nikos Hidalgo
            Nov 14 '18 at 10:19















          0














          If you're wondering about how to place the menu to fall half on the top view and half on the bottom view, just drag it manually to the position you want to have it, and on the design tab of Android studio select the Magic Wand icon, to "infer constraints". As for the views in the background make sure you add app:layout_constraintBottomToTopOf="yourBottomView" to your view on top and app:layout_constraintTopToBottomOf="yourTopView".



          Check the codelabs tutorial on Constraint Layout here for more info, or the documentation on the developers' website here



          EDIT:



          <?xml version="1.0" encoding="utf-8"?>
          <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent">

          <ImageView
          android:id="@+id/imageView"
          android:layout_width="match_parent"
          android:layout_height="100dp"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          android:layout_marginTop="8dp"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          app:srcCompat="@android:color/holo_blue_bright" />

          <ImageView
          android:id="@+id/imageView2"
          android:layout_width="match_parent"
          android:layout_height="450dp"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/imageView"
          app:srcCompat="@android:color/darker_gray" />

          <android.support.constraint.ConstraintLayout
          android:id="@+id/constraintLayout"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          app:layout_constraintBottom_toBottomOf="@+id/imageView"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/imageView">

          <TextView
          android:id="@+id/textView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView"
          app:layout_constraintEnd_toStartOf="@+id/textView2"
          app:layout_constraintHorizontal_chainStyle="packed"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent" />

          <TextView
          android:id="@+id/textView2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView"
          app:layout_constraintEnd_toStartOf="@+id/textView3"
          app:layout_constraintHorizontal_chainStyle="packed"
          app:layout_constraintStart_toEndOf="@+id/textView"
          app:layout_constraintTop_toTopOf="parent" />

          <TextView
          android:id="@+id/textView3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_chainStyle="packed"
          app:layout_constraintStart_toEndOf="@+id/textView2"
          app:layout_constraintTop_toTopOf="parent" />
          </android.support.constraint.ConstraintLayout>
          </android.support.constraint.ConstraintLayout>


          This is what I get from the above:
          layout






          share|improve this answer

























          • No this rounded view has adjusted ht these three buttons and textviews are not come in center on changing multiple devices.

            – Maryam
            Nov 14 '18 at 7:52











          • @Maryam I would organise the three buttons/textviews into a separate constraint layout within the bigger layout, to make sure you keep the balance, and then constraint that layout as one item, instead of trying to center each of the views

            – Nikos Hidalgo
            Nov 14 '18 at 9:35











          • @Maryam I edited my answer to include some guideline code for the layout

            – Nikos Hidalgo
            Nov 14 '18 at 10:19













          0












          0








          0







          If you're wondering about how to place the menu to fall half on the top view and half on the bottom view, just drag it manually to the position you want to have it, and on the design tab of Android studio select the Magic Wand icon, to "infer constraints". As for the views in the background make sure you add app:layout_constraintBottomToTopOf="yourBottomView" to your view on top and app:layout_constraintTopToBottomOf="yourTopView".



          Check the codelabs tutorial on Constraint Layout here for more info, or the documentation on the developers' website here



          EDIT:



          <?xml version="1.0" encoding="utf-8"?>
          <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent">

          <ImageView
          android:id="@+id/imageView"
          android:layout_width="match_parent"
          android:layout_height="100dp"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          android:layout_marginTop="8dp"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          app:srcCompat="@android:color/holo_blue_bright" />

          <ImageView
          android:id="@+id/imageView2"
          android:layout_width="match_parent"
          android:layout_height="450dp"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/imageView"
          app:srcCompat="@android:color/darker_gray" />

          <android.support.constraint.ConstraintLayout
          android:id="@+id/constraintLayout"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          app:layout_constraintBottom_toBottomOf="@+id/imageView"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/imageView">

          <TextView
          android:id="@+id/textView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView"
          app:layout_constraintEnd_toStartOf="@+id/textView2"
          app:layout_constraintHorizontal_chainStyle="packed"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent" />

          <TextView
          android:id="@+id/textView2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView"
          app:layout_constraintEnd_toStartOf="@+id/textView3"
          app:layout_constraintHorizontal_chainStyle="packed"
          app:layout_constraintStart_toEndOf="@+id/textView"
          app:layout_constraintTop_toTopOf="parent" />

          <TextView
          android:id="@+id/textView3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_chainStyle="packed"
          app:layout_constraintStart_toEndOf="@+id/textView2"
          app:layout_constraintTop_toTopOf="parent" />
          </android.support.constraint.ConstraintLayout>
          </android.support.constraint.ConstraintLayout>


          This is what I get from the above:
          layout






          share|improve this answer















          If you're wondering about how to place the menu to fall half on the top view and half on the bottom view, just drag it manually to the position you want to have it, and on the design tab of Android studio select the Magic Wand icon, to "infer constraints". As for the views in the background make sure you add app:layout_constraintBottomToTopOf="yourBottomView" to your view on top and app:layout_constraintTopToBottomOf="yourTopView".



          Check the codelabs tutorial on Constraint Layout here for more info, or the documentation on the developers' website here



          EDIT:



          <?xml version="1.0" encoding="utf-8"?>
          <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent">

          <ImageView
          android:id="@+id/imageView"
          android:layout_width="match_parent"
          android:layout_height="100dp"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          android:layout_marginTop="8dp"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          app:srcCompat="@android:color/holo_blue_bright" />

          <ImageView
          android:id="@+id/imageView2"
          android:layout_width="match_parent"
          android:layout_height="450dp"
          android:layout_marginEnd="8dp"
          android:layout_marginStart="8dp"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/imageView"
          app:srcCompat="@android:color/darker_gray" />

          <android.support.constraint.ConstraintLayout
          android:id="@+id/constraintLayout"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          app:layout_constraintBottom_toBottomOf="@+id/imageView"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toBottomOf="@+id/imageView">

          <TextView
          android:id="@+id/textView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView"
          app:layout_constraintEnd_toStartOf="@+id/textView2"
          app:layout_constraintHorizontal_chainStyle="packed"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent" />

          <TextView
          android:id="@+id/textView2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView"
          app:layout_constraintEnd_toStartOf="@+id/textView3"
          app:layout_constraintHorizontal_chainStyle="packed"
          app:layout_constraintStart_toEndOf="@+id/textView"
          app:layout_constraintTop_toTopOf="parent" />

          <TextView
          android:id="@+id/textView3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="TextView"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintHorizontal_chainStyle="packed"
          app:layout_constraintStart_toEndOf="@+id/textView2"
          app:layout_constraintTop_toTopOf="parent" />
          </android.support.constraint.ConstraintLayout>
          </android.support.constraint.ConstraintLayout>


          This is what I get from the above:
          layout







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 14 '18 at 10:19

























          answered Nov 13 '18 at 15:16









          Nikos HidalgoNikos Hidalgo

          1,1781318




          1,1781318












          • No this rounded view has adjusted ht these three buttons and textviews are not come in center on changing multiple devices.

            – Maryam
            Nov 14 '18 at 7:52











          • @Maryam I would organise the three buttons/textviews into a separate constraint layout within the bigger layout, to make sure you keep the balance, and then constraint that layout as one item, instead of trying to center each of the views

            – Nikos Hidalgo
            Nov 14 '18 at 9:35











          • @Maryam I edited my answer to include some guideline code for the layout

            – Nikos Hidalgo
            Nov 14 '18 at 10:19

















          • No this rounded view has adjusted ht these three buttons and textviews are not come in center on changing multiple devices.

            – Maryam
            Nov 14 '18 at 7:52











          • @Maryam I would organise the three buttons/textviews into a separate constraint layout within the bigger layout, to make sure you keep the balance, and then constraint that layout as one item, instead of trying to center each of the views

            – Nikos Hidalgo
            Nov 14 '18 at 9:35











          • @Maryam I edited my answer to include some guideline code for the layout

            – Nikos Hidalgo
            Nov 14 '18 at 10:19
















          No this rounded view has adjusted ht these three buttons and textviews are not come in center on changing multiple devices.

          – Maryam
          Nov 14 '18 at 7:52





          No this rounded view has adjusted ht these three buttons and textviews are not come in center on changing multiple devices.

          – Maryam
          Nov 14 '18 at 7:52













          @Maryam I would organise the three buttons/textviews into a separate constraint layout within the bigger layout, to make sure you keep the balance, and then constraint that layout as one item, instead of trying to center each of the views

          – Nikos Hidalgo
          Nov 14 '18 at 9:35





          @Maryam I would organise the three buttons/textviews into a separate constraint layout within the bigger layout, to make sure you keep the balance, and then constraint that layout as one item, instead of trying to center each of the views

          – Nikos Hidalgo
          Nov 14 '18 at 9:35













          @Maryam I edited my answer to include some guideline code for the layout

          – Nikos Hidalgo
          Nov 14 '18 at 10:19





          @Maryam I edited my answer to include some guideline code for the layout

          – Nikos Hidalgo
          Nov 14 '18 at 10:19



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53283455%2fhow-to-make-a-layout-like-this-image-using-constraint-layout%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Use pre created SQLite database for Android project in kotlin

          Darth Vader #20

          Ondo