ConstraintLayout 水平比例佈局 1:1:2
ConstraintLayout 水平比例佈局 1:1:2
//以下程式碼展示了一個 1:1:2的ConstraintLayout佈局, 關鍵點就是 位置的left,right的擺放,才能出現這個效果。 認真體會
<?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"
tools:context="com.okaylens.it8951demo.MainActivity">
<Button
android:id="@+id/connect_usb_bt"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintRight_toLeftOf="@id/send_bmp_bt"
android:layout_width="0dp"
android:layout_height="100dp"
/>
<Button
app:layout_constraintTop_toTopOf="parent"
android:id="@+id/send_bmp_bt"
app:layout_constraintLeft_toRightOf="@id/connect_usb_bt"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintRight_toLeftOf="@id/send_jpg_bt"
android:layout_width="0dp"
android:layout_height="100dp"
/>
<Button
app:layout_constraintTop_toTopOf="parent"
android:id="@+id/send_jpg_bt"
app:layout_constraintLeft_toRightOf="@id/send_bmp_bt"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintHorizontal_weight="2"
android:layout_width="0dp"
android:layout_height="100dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</android.support.constraint.ConstraintLayout>
相關文章
- Flutter佈局篇(1)–水平和垂直佈局詳解Flutter
- Flutter佈局篇(1)--水平和垂直佈局詳解Flutter
- CSS 佈局之水平居中佈局CSS
- css佈局系列1——盒模型佈局CSS模型
- flutter佈局-1-columnFlutter
- Android入門教程:ConstraintLayout約束佈局AndroidAI
- Android——ConstraintLayout的使用,優化佈局效能AndroidAI優化
- 像ConstraintLayout一樣分解你的佈局AI
- 佈局總結-水平居中佈局的實現
- [css佈局1]不知寬高情況下,水平垂直居中的幾種方式CSS
- Android 隨筆—— 最強大的佈局 ConstraintLayoutAndroidAI
- Android 約束佈局(ConstraintLayout)1.1.0 版詳解AndroidAI
- 前端面試1:CSS佈局前端面試CSS
- CSS之寬高比例佈局CSS
- Flutter基礎-009-Row水平佈局與Column垂直佈局Flutter
- GO QT5 水平垂直佈局GoQT
- Css規範整理:1、佈局大綱CSS
- Android開發-掌握ConstraintLayout(一)傳統佈局的問題AndroidAI
- Android開發 - 掌握ConstraintLayout(一)傳統佈局的問題AndroidAI
- Android Material Design控制元件使用(一)——ConstraintLayout 約束佈局AndroidMaterial Design控制元件AI
- 約束佈局ConstraintLayout看這一篇就夠了AI
- ConstraintLayout 約束佈局的幾個新特性筆記整理AI筆記
- Element原始碼分析系列1一Layout(佈局)原始碼
- flutter 學習筆記-容器與佈局(1)Flutter筆記
- 實戰電商頁面1:靜態佈局
- 水平垂直居中佈局的多種實現方式
- cad比例怎麼調1:100 cad1:100比例怎麼設定
- Flutter 開發從 0 到 1(三)佈局與 ListViewFlutterView
- 父盒子寬度不固定水平居中彈性佈局
- flutter佈局-2-rowFlutter
- Web 開發者如何理解 Flutter 佈局之 —— 1. TextWebFlutter
- #06-1你認真學了css?佈局基礎CSS
- iOS混合開發庫(GICXMLLayout)佈局案例分析(1)今日頭條案例iOSXML
- [Flutter翻譯]Flutter Anatomy - 佈局內部的第1部分Flutter
- const nums1 = [1, 2, 2, 1], nums2 = [2] 交集是什麼?
- css佈局-float佈局CSS
- CSS佈局 --- 居中佈局CSS
- 2020-12-17 html、css面試題3: 水平垂直居中,左右固定中間自適應 三欄佈局,靜態佈局、自適應佈局、流式佈局、響應式佈局、彈性佈局,IE中常見的相容性問題,清空陣列的方法HTMLCSS面試題陣列
- Linux 輸出重定向 2>&1 , 1>&2Linux