Android – how to make a scrollable constraintlayout?

I want to make a layout that lets me scroll down using constraint layout, but I don’t know how to go about it. Should the ScrollView be the parent of the ConstraintLayout like this? <?xml version=”1.0″ encoding=”utf-8″?> <ScrollView 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” android:fillViewport=”true”> <android.support.constraint.ConstraintLayout android:id=”@+id/Constraint” android:layout_width=”match_parent” android:layout_height=”match_parent”/> Or the other way around? Maybe someone … Read more

How to center the elements in ConstraintLayout

I am using ConstraintLayout in my application to make applications layout. I am trying to a create a screen wheren one EditText and Button should be in center and Button should be below of EditText with a marginTop only 16dp. Here is my layout and screenshot how it is looking right now. activity_authenticate_content.xml <android.support.constraint.ConstraintLayout xmlns:android=”http://schemas.android.com/apk/res/android” … Read more

How to make ConstraintLayout work with percentage values?

With a Preview 1 of Android Studio 2.2 Google released a new layout in its support library: ConstraintLayout. With ConstraintLayout it is easier to use a Design tool in Android Studio, but I didn’t find a way to use relative sizes (percents or ‘weights’ like in LinearLayout). Is there a way to define the constraints … Read more