Mais conteúdo relacionado Semelhante a Constraint layout - New Hope (20) Constraint layout - New Hope3. ●What is it all about?
●How to start
●Constraint Layout’s features
●Should we use it?
5. <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello!"/>
<!-- etc... -->
Nested layouts
A lot of measure cycles!
8. Constraint Layout!
● Announced at Google I/O 2016
● Relative Layout on roids
● Flexible
● Helps keeping flat layout hierarchy
● Tied with the new Layout Editor
● Unbundled library
10. ● Android Studio 2.3
● Min. API 9
● Gradle dependency:
Requirements
compile 'com.android.support.constraint:constraint-layout:1.0.2'
13. Link to the example
https://github.com/gmatyszczak/constraint-layout-demo
14. ● Horizontal / vertical bias
● Guidelines
● Chains
● Aspect ratio
● Constraint set
Features we which used