NI
Neo Ighodaro 7 years ago
This should possibly be a link to the iOS Swift autolayout article you will writ
- Getting started with ConstraintLayout in Kotlin - Part 1: introduction to ConstraintLayout
- Introduction
- Prerequisites
- The advent of the ConstraintLayout
- Bottlenecks of other layouts
- Some more interesting features of ConstraintLayout
- Setting up our Android project
- Conclusion
Introduction
Prerequisites
The advent of the ConstraintLayout
Bottlenecks of other layouts
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout>
<LinearLayout>
<LinearLayout>
<TextView></TextView>
</LinearLayout>
<ImageView></ImageView>
</LinearLayout>
<TextView></TextView>
<LinearLayout>
<Button></Button>
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<ConstraintLayout>
<TextView></TextView>
<ImageView></ImageView>
<TextView></TextView>
<Button></Button>
</ConstraintLayout>
Some more interesting features of ConstraintLayout
Setting up our Android project
buildscript {
repositories {
google()
}
[...]
}
dependencies {
[...]
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
}
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
<?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">
<!-- Other views go here --!>
</android.support.constraint.ConstraintLayout>
Conclusion