ConstraintLayout (約束佈局)屬性詳情

来源:https://www.cnblogs.com/vincentGan/archive/2018/07/29/9384228.html
-Advertisement-
Play Games

本文部分內容來自於網路,點擊瀏覽原文 app:layout_constraintLeft_toLeftOf //Constrains the left side of a child to the left side of a target child (contains the target ch ...


本文部分內容來自於網路,點擊瀏覽原文

app:layout_constraintLeft_toLeftOf

//Constrains the left side of a child to the left side of a target child (contains the target child id).

表示此控制項的左邊框與某個控制項的左邊框對齊或者在其右邊


視圖1

 


代碼1

 

app:layout_constraintLeft_toRightOf

//Constrains the left side of a child to the right side of a target child (contains the target child id).

表示此控制項的左邊框與某個控制項的右邊框對齊或者在其右邊


視圖2

 

app:layout_constraintRight_toLeftOf

//Constrains the right side of a child to the left side of a target child (contains the target child id).

表示此控制項的右邊框與某個控制項的左邊框對齊或在其左邊


視圖3

 

app:layout_constraintRight_toRightOf

//Constrains the right side of a child to the right side of a target child (contains the target child id).

表示此控制項的右邊框與某個控制項的右邊框對齊或在其左邊


視圖4

 

app:layout_constraintTop_toTopOf

//Constrains the top side of a child to the top side of a target child (contains the target child id).

表示此控制項的頂部邊框與某個控制項的頂部邊框水平對齊或在其下邊


視圖5

 

app:layout_constraintTop_toBottomOf

//Constrains the top side of a child to the bottom side of a target child (contains the target child id).

表示此控制項的頂部邊框與某個控制項的底部邊框水平對齊或在其下邊


視圖6

 

app:layout_constraintBottom_toTopOf

//Constrains the bottom side of a child to the top side of a target child (contains the target child id).

表示此控制項的底部邊框與某個控制項的頂部邊框水平對齊或其上邊


視圖7

 

app:layout_constraintBottom_toBottomOf

//Constrains the bottom side of a child to the bottom side of a target child (contains the target child id).

表示此控制項的底部邊框與某個控制項的底部邊框水平對齊或其上邊


視圖8

 

app:layout_constraintBaseline_toBaselineOf

//Constrains the baseline of a child to the baseline of a target child (contains the target child id).

表示此控制項與某個控制項水平對齊


視圖9

 


代碼2

 

app:layout_editor_absoluteX

//The design time location of the left side of the child.

表示此控制項在佈局中X軸的絕對坐標點。如圖代碼3


代碼3

 

app:layout_editor_absoluteY

//The design time location of the right side of the child.

表示此控制項在佈局中Y軸的絕對坐標點。如圖代碼3

app:layout_constraintGuide_begin

//The distance of child (guideline) to the top or left edge of its parent.

表示在佈局中引導線距頂部或左邊框的距離(如:20dp表示距頂部或者左邊框20dp)


視圖10

 

 


代碼10

 

app:layout_constraintGuide_end

//The distance of child (guideline) to the top or left edge of its parent.

表示在佈局中引導線距底部的距離(如:10dp表示距頂部10dp)

app:layout_constraintGuide_percent

//The ratio of the distance to the parent's sides

表示在整個佈局中引導線距離左邊框的百分百(如:app:layout_constraintGuide_percent="0.5"表示距離左邊框50%的位置)


視圖11

 

 


代碼11

 

app:layout_constraintStart_toEndOf

//Constrains the start side of a child to the end side of a target child (contains the target child id).

表示此控制項的左邊界在某個控制項右邊界的右邊,及表示此控制項在某個控制項的右邊


視圖12

 

app:layout_constraintStart_toStartOf

//Constrains the start side of a child to the start side of a target child (contains the target child id).

表示此控制項的左邊界與某個控制項的左邊界在同一垂直線上


視圖13

 

app:layout_constraintEnd_toStartOf

//Constrains the end side of a child to the start side of a target child (contains the target child id).

表示此控制項的右邊界與某個控制項的左邊界在同一垂直線上


視圖14

 

app:layout_constraintEnd_toEndOf

//Constrains the end side of a child to the end side of a target child (contains the target child id).

表示此控制項的右邊界與某個控制項的右邊界對齊


視圖15

 

app:layout_constraintHorizontal_bias

//The ratio between two connections when the left and right (or start and end) sides are constrained.

表示此控制項在佈局中的水平方向上的偏移百分百。如視圖16,代碼16


視圖16

 

app:layout_constraintVertical_bias

//The ratio between two connections when the top and bottom sides are constrained.

表示此控制項在佈局中的的垂直方向上的偏移百分百。如視圖16,代碼16


代碼16

 

app:layout_constraintDimensionRatio

//The child's side to constrain using dimensRatio.

表示兩個控制項的縱橫比,而使用則需要把寬(layout_width)或者高(layout_height)設置為0dp,根據另一個屬性和比例, 計算當前屬性, 如兩個圖片控制項的顯示大小,app:layout_constraintDimensionRatio="4:3";

 


視圖13

 

app:layout_goneMarginLeft

//The left margin to use when the target is gone.

app:layout_goneMarginTop

//The top margin to use when the target is gone.

app:layout_goneMarginRight

//The right margin to use when the target is gone

app:layout_goneMarginBottom

//The bottom margin to use when the target is gone.

app:layout_goneMarginStart

//The start margin to use when the target is gone.

app:layout_goneMarginEnd

//The end margin to use when the target is gone.


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 在對文檔(Document)中的內容進行索引前, 需要對域(Field)中的內容使用分析對象(分詞器)進行分詞. IK分詞器是一款功能完備、擴展性較高的中文分詞器, 企業開發中使用較多. ...
  • 存儲過程 一組用於完成特定資料庫功能的SQL語句集,該SQL語句集經過編譯後存儲在資料庫系統中。在使用時候,用戶通過指定已經定義的存儲過程名字並給出相應的存儲過程參數來調用並執行它,從而完成一個或一系列的資料庫操作。 包含三部分:過程聲明,執行過程部分,存儲過程異常(可選)。 示例 項目運用 1.獲 ...
  • 效果圖: 參考地址: https://blog.csdn.net/w3chhhhhh/article/details/54097890 ...
  • 1、表和sql的優化 -》大表拆分成小表、分區表、外部表、臨時表都是屬於優化的一塊 -》分區表:檢索更快速 -》外部表:數據安全性 -》臨時表&拆分子表:簡化複雜的SQL以及需求 2、SQL可以從join和fliter兩方面深入 3、MR優化 -》map和reduce的個數 -》一個分片就是一個塊, ...
  • 課程教師:李興華 課程學習者:陽光羅諾 日期:2018-07-28 知識點: 1、 瞭解PL/SQL的主要特點 2、 掌握PL/SQL塊的基本結構 PL/SQL PL/SQL是Oracle在關係資料庫結構化查詢語言SQL基礎上擴展得到的一種過程化查詢語言。 SQL與編程語言之間的不同之處在於,SQL ...
  • 最近很多人都想學習大數據開發,但是卻不知道如何開始學習,今天軟妹子專門整理了一份針對大數據初學者的大數據開發學習路線。 下麵分十個章節來說明大數據開發要學習的內容: 以上就是一個大數據新手,想要學會大數據開發,需要學習的內容,大數據學習是一個持續的過程,只要用心學,沒有學不會的東西哦!我要推薦下我自 ...
  • 一、整體瞭解數據分析新人們被”大數據“、”人工智慧“、”21世紀是數據分析師的時代“等等信息吸引過來,立志成為一名數據分析師,於是問題來了,數據分析到底是乾什麼的?數據分析都包含什麼內容?市面上有很多講數據分析內容的書籍,在此我推薦《深入淺出數據分析》,此書對有基礎人士可稱消遣讀物, 但對新人們還是 ...
  • 占座 ...
一周排行
    -Advertisement-
    Play Games
  • 前言 本文介紹一款使用 C# 與 WPF 開發的音頻播放器,其界面簡潔大方,操作體驗流暢。該播放器支持多種音頻格式(如 MP4、WMA、OGG、FLAC 等),並具備標記、實時歌詞顯示等功能。 另外,還支持換膚及多語言(中英文)切換。核心音頻處理採用 FFmpeg 組件,獲得了廣泛認可,目前 Git ...
  • OAuth2.0授權驗證-gitee授權碼模式 本文主要介紹如何筆者自己是如何使用gitee提供的OAuth2.0協議完成授權驗證並登錄到自己的系統,完整模式如圖 1、創建應用 打開gitee個人中心->第三方應用->創建應用 創建應用後在我的應用界面,查看已創建應用的Client ID和Clien ...
  • 解決了這個問題:《winForm下,fastReport.net 從.net framework 升級到.net5遇到的錯誤“Operation is not supported on this platform.”》 本文內容轉載自:https://www.fcnsoft.com/Home/Sho ...
  • 國內文章 WPF 從裸 Win 32 的 WM_Pointer 消息獲取觸摸點繪製筆跡 https://www.cnblogs.com/lindexi/p/18390983 本文將告訴大家如何在 WPF 裡面,接收裸 Win 32 的 WM_Pointer 消息,從消息裡面獲取觸摸點信息,使用觸摸點 ...
  • 前言 給大家推薦一個專為新零售快消行業打造了一套高效的進銷存管理系統。 系統不僅具備強大的庫存管理功能,還集成了高性能的輕量級 POS 解決方案,確保頁面載入速度極快,提供良好的用戶體驗。 項目介紹 Dorisoy.POS 是一款基於 .NET 7 和 Angular 4 開發的新零售快消進銷存管理 ...
  • ABP CLI常用的代碼分享 一、確保環境配置正確 安裝.NET CLI: ABP CLI是基於.NET Core或.NET 5/6/7等更高版本構建的,因此首先需要在你的開發環境中安裝.NET CLI。這可以通過訪問Microsoft官網下載並安裝相應版本的.NET SDK來實現。 安裝ABP ...
  • 問題 問題是這樣的:第三方的webapi,需要先調用登陸介面獲取Cookie,訪問其它介面時攜帶Cookie信息。 但使用HttpClient類調用登陸介面,返回的Headers中沒有找到Cookie信息。 分析 首先,使用Postman測試該登陸介面,正常返回Cookie信息,說明是HttpCli ...
  • 國內文章 關於.NET在中國為什麼工資低的分析 https://www.cnblogs.com/thinkingmore/p/18406244 .NET在中國開發者的薪資偏低,主要因市場需求、技術棧選擇和企業文化等因素所致。歷史上,.NET曾因微軟的閉源策略發展受限,儘管後來推出了跨平臺的.NET ...
  • 在WPF開發應用中,動畫不僅可以引起用戶的註意與興趣,而且還使軟體更加便於使用。前面幾篇文章講解了畫筆(Brush),形狀(Shape),幾何圖形(Geometry),變換(Transform)等相關內容,今天繼續講解動畫相關內容和知識點,僅供學習分享使用,如有不足之處,還請指正。 ...
  • 什麼是委托? 委托可以說是把一個方法代入另一個方法執行,相當於指向函數的指針;事件就相當於保存委托的數組; 1.實例化委托的方式: 方式1:通過new創建實例: public delegate void ShowDelegate(); 或者 public delegate string ShowDe ...