Guidelines in Android ConstraintLayout Last Updated : 13 Sep, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report Guidelines in Constraint Layout are invisible lines that are not visible to users but help developers to design the layout easily and constrain views to these guidelines, so that design can be more clear and interactive. But guidelines only work in Constraint Layout as guidelines require something to be constrained to them. There are two types of guidelines:Horizontal Guidelines: These guidelines have a height of zero and its width is equal to its parent Constraint Layout.Vertical Guidelines: These guidelines have a width of zero and its height is equal to its parent Constraint Layout.Horizontal and vertical guidelines Now we can position guidelines in three different ways: By using (layout_constraintGuide_begin) to specify a fixed distance from the left or the top of a layout.By using (layout_constraintGuide_end) to specify a fixed distance from the right or the bottom of a layout.By using (layout_constraint_percent) to specify percentage of the width or the height of a layout. Note: Guidelines can only be used with Constraint layout. To know about constraint layout you can refer Constraint layout. The following steps can be used to make use of guidelines: Step 1: Use constraint layout in your application. Step 2: Click on the icon shown below or you can also search horizontal or vertical guidelines in palette. Step 3: Select guidelines which you want to use (horizontal or vertical). Step 4: Use following code to use attributes to position guidelines in end, begin and decide percentage of width or height of layout. XML <androidx.constraintlayout.widget.Guideline android:id="@+id/guideline7" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" app:layout_constraintGuide_begin="20dp" /> <androidx.constraintlayout.widget.Guideline android:id="@+id/guideline8" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" app:layout_constraintGuide_end="20dp" /> <androidx.constraintlayout.widget.Guideline android:id="@+id/guideline5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" app:layout_constraintGuide_begin="20dp" /> <androidx.constraintlayout.widget.Guideline android:id="@+id/guideline6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" app:layout_constraintGuide_end="20dp" /> <androidx.constraintlayout.widget.Guideline android:id="@+id/guideline9" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" app:layout_constraintGuide_begin="20dp" app:layout_constraintGuide_percent="0.75" /> Hence, guidelines can be used as taught above and can help Android developers to design interactive layouts. Comment More infoAdvertise with us Next Article Relative Layout in Android J jangirkaran17 Follow Improve Article Tags : Android Similar Reads ConstraintLayout in Android ConstraintLayout is the most advanced layout in Android that lets you create complex and responsive UIs while minimizing nested views due to its flat view hierarchy. ConstraintLayout is similar to that of other View Groups which we have seen in Android such as RelativeLayout, LinearLayout, and many 6 min read Constraints in Android Constraints are a fundamental part of the modern Android UI design, especially with the use of the ConstraintLayout. It can provide a flexible and efficient way to design complex user interfaces without nesting the multiple ViewGroups.This article will guide you through the concepts of the constrain 4 min read ConstraintLayout in Android using Jetpack Compose ConstraintLayout is the view system in a ViewGroup to place widgets relative to the position of other widgets on the screen. In jetpack compose, almost every layout can be created using Rows and Columns but if you want to create larger complicated Layouts you can also use Constraint Layout as an alt 3 min read Base Line Constraints in Android When developing Android applications, it can be essential to align the UI elements correctly to create a visually appealing and user-friendly interface. Baseline constraints in the ConstraintLayout can provide a powerful way to align the text views based on their text baselines. This article will gu 3 min read Relative Layout in Android Relative Layout in Android is a layout that arranges its child views in relation to each other. Unlike Linear Layout, which can make element arrangement complex, RelativeLayout simplifies the process by allowing flexible and dynamic positioning. It enables you to align views relative to each other o 3 min read FrameLayout in Android Android Framelayout is a ViewGroup subclass that is used to specify the position of multiple views placed on top of each other to represent a single view screen. Generally, we can say FrameLayout simply blocks a particular area on the screen to display a single view. Here, all the child views or ele 3 min read Like