Constraintlayout

透過相對定位,靈活調整小工具的位置和大小。

這個資料表會列出 androidx.constraintlayout 群組中的所有構件。

構件 穩定版 候選版 Beta 版 Alpha 版
constraintlayout 2.1.4 版 - - 2.2.0-alpha14
constraintlayout-compose 1.0.1 - - 1.1.0-alpha14
constraintlayout-core 1.0.4 版 - - 1.1.0-alpha14

宣告依附元件

如要在 ConstraintLayout 中新增依附元件,您必須將 Google Maven 存放區新增至專案。詳情請參閱 Google 的 Maven 存放區

在應用程式或模組的 build.gradle 檔案中,新增所需構件的依附元件:

Groovy

dependencies {
    implementation "androidx.constraintlayout:constraintlayout:2.2.0-alpha14"
    // To use constraintlayout in compose
    implementation "androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha14"
}

Kotlin

dependencies {
    implementation("androidx.constraintlayout:constraintlayout:2.2.0-alpha14")
    // To use constraintlayout in compose
    implementation("androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha14")
}

如要進一步瞭解依附元件,請參閱「新增建構依附元件」一文。

意見回饋

您的意見可協助我們改善 Jetpack。如果您發現新問題,或是有改進這個程式庫的建議,請告訴我們。回報新問題前,請先查看這個程式庫的現有問題。只要按一下星號按鈕,即可投票給現有的問題。

建立新問題

詳情請參閱 Issue Tracker 說明文件

ConstraintLayout-compose 和 ConstraintLayout-Core 1.1

1.1.0-alpha14 版

2024 年 8 月 7 日

發布 androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha14androidx.constraintlayout:constraintlayout-compose-android:1.1.0-alpha14androidx.constraintlayout:constraintlayout-core:1.1.0-alpha14。1.1.0-alpha14 版包含這些修訂版本

API 變更

  • 旗標現在是透過伴生物件個別提供,而且可能會與 or 運算子合併使用。(I9df53)。
  • 簡化版 createRow &createColumn 助手。改善 createGrid 參數名稱和說明文件,以便釐清問題。(Iebc92)。
  • 已簡化 ConstraintLayout 中的 animateChanges API,只需要使用非空值的 AnimationSpecInvalidationStrategy 中的 onIncomingConstraints 現在是一般的 lambda。fixedWidthRate 已重新命名為 shouldInvalidateOnFixedWith,適用於高度變化版本。(Ie59cdb/332898040b/336370035)
  • 「拖曳」和「Fling」的 NestedScroll 來源現已由 UserInputSideEffect 取代,以因應這些來源的延伸定義,這些來源現在包含動畫 (連帶效果) 以及滑鼠滾輪和鍵盤 (UserInput)。(I40579)。

1.1.0-alpha13 版本

2023 年 10 月 4 日

發布 androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha13androidx.constraintlayout:constraintlayout-compose-android:1.1.0-alpha13androidx.constraintlayout:constraintlayout-core:1.1.0-alpha13,但沒有任何異動。1.1.0-alpha13 版包含以下修訂項目。

  • 這個版本允許 androidx.constraintlayout 程式庫與最新版 Compose 相容的 ABI。

1.1.0-alpha12 版本

2023 年 8 月 9 日

發布 androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha12androidx.constraintlayout:constraintlayout-compose-android:1.1.0-alpha12androidx.constraintlayout:constraintlayout-core:1.1.0-alpha121.1.0-alpha12 版包含以下修訂項目。

API 變更

  • 在轉換 DSL 中新增 LayoutScopeMarker。(If54ce)。

1.1.0-alpha11 版本

2023 年 7 月 26 日

發布 androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha11androidx.constraintlayout:constraintlayout-compose-android:1.1.0-alpha11androidx.constraintlayout:constraintlayout-core:1.1.0-alpha111.1.0-alpha11 版包含以下修訂項目。

新功能

  • 您現在可以提供 InvalidationStrategy,將 MotionLayout 中的撤銷作業最佳化。通常會導致成效下滑。(Iada0c)。
  • 現在,將 ConstraintLayout 與內嵌修飾符 DSL (Modifier.constrainAs) 搭配使用時,您現在可以使用 animateChanges = true,每當執行 ConstraintLayoutL 的限制變更時,系統就會自動建立動畫到該新狀態。(I9abf1)。
  • 已在 OnSwipe 上為 limitBoundsTo 啟用這項功能。(I56522)。

API 變更

  • TransitionScope.staggered 已重新命名為 TransitionScope.maxStaggerDelay。(I0fd2d)。

修正錯誤

  • 修正了 OnSwipedragScale 參數無法運作的問題。(8bef26)。
  • 修正 MotionScene 中的 customColor 無法使用透明顏色時無法正常運作的問題。(81b2ac)。
  • 修正 OnSwipe 停止時無法正確通知,同時也修正 touchUp 的初始速率計算問題。(Ia5f6f)。
  • 已更新 ConstraintLayout 可組合函式和 Constraintset 的 KDoc。(3bfe63)。

1.1.0-alpha10 版

2023 年 5 月 24 日

發布 androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha10androidx.constraintlayout:constraintlayout-compose-android:1.1.0-alpha10androidx.constraintlayout:constraintlayout-core:1.1.0-alpha101.1.0-alpha10 版包含以下修訂項目。

API 變更

  • MotionLayout API 不再處於實驗階段,代表 MotionLayout 的初始穩定 API 組合。(I288f4)。
  • 已移除 MotionLayoutState。(Id3ac1)。
  • 您現在可以使用 DebugFlags 進行視覺偵錯:DebugFlags(showBounds = true)。(Ic714b)。
  • 已將擴充功能變數 Dp.asDimension 變更為方法:Dp.asDimension()。(I2d6ef)。
  • MotionLayout DSL 現已支援分段,可使用 TransitionScope.staggered 定義最長延遲時間,您也可以使用 ConstrainScope.staggeredWeight (在 MotionSceneScope 內) 取得自訂分段順序。(I70275)。
  • 針對 Grid 輔助程式做了兩項變更:1.paddingLeftpaddingRight 分別對應至 paddingStartpaddingEnd,以及 2. 將 gridSpansgridSkip 的格式更新為 Span 和 Skip 物件的陣列,讓結構更大。(Idd1eb)。

1.1.0-alpha09 版本

2023 年 3 月 22 日

發布 androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha09androidx.constraintlayout:constraintlayout-core:1.1.0-alpha091.1.0-alpha09 版包含以下修訂項目。

API 變更

  • Modifier.intermediateLayout 現在不需要明確的 LookaheadScopeintermediateLayout 中的測量區塊具有 IntermediateMeasureScope 做為接收器,可提供便利的 CoroutineScopeLookaheadScopeMeasureScope
  • LookaheadLayout 已由 LookaheadScope 取代,不再是版面配置。這可讓家長的 MeasurePolicy 直接控管 LookaheadScope 中的子項內容。(Ibe2e5)。
  • Easing.Cubic() 現在可以接管參數。(I2d826)。

1.1.0-alpha08 版本

2023 年 3 月 8 日

發布 androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha08androidx.constraintlayout:constraintlayout-core:1.1.0-alpha081.1.0-alpha08 版包含以下修訂項目。

新功能

  • 新增 Lint 檢查功能,建議在典型模式可能導致無法預測的行為時,使用 Dimension.percent(1f)LayoutReference.withChainParams()。(I62eb0I03060)

API 變更

  • 在 Compose 中為格線輔助程式啟用 ReverseSpanDirectionSpansOrderFirst 標記。
    1. ReverseSpanDirection:反轉跨距/略過寬度和高度規格。
    2. SpansOrderFirst:範圍會遵循小工具的順序。(I6ad50)。
  • 使用 Modifier.onStartEndBoundsChanged(...) 取得 MotionLayout 中可受動畫影響的可組合項本機邊界。適用於任何需要同時可能觸發動畫的版面配置資訊的 UI 互動,例如 DragAndDrop。(I6b5f9)。
  • 在 Compose 中啟用格線輔助程式的略過和時距 (I917b6)

修正錯誤

  • 修正的轉譯屬性未套用預期值。(I961cd)。

1.1.0-alpha07 版本

2023 年 2 月 8 日

發布 androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha07androidx.constraintlayout:constraintlayout-core:1.1.0-alpha071.1.0-alpha07 版包含以下修訂項目。

新功能

  • 新增 API,以使用 DSL 在 Compose 中啟用格線輔助功能 (I1143b)

修正錯誤

  • 修正了 Flow 的 Wrap.Chain 無法正確套用至指定 maxElement 參數的問題(e1f2ed3)。
  • 修正了在透過 MotionLayout(motionScene: MotionScene, progress: Float, transitionName: String) 變更 Transition 時,start ConstraintSet 無法更新的問題(17ffff1)。
  • 修正了在透過 ConstraintSet(extendConstraintSet: ConstraintSet, description: ConstraintSetScope.() -> Unit) 繼承限制時,ConstraintSet 無法反映部分變更的問題 (740804b)。

1.1.0-alpha06 版本

2023 年 1 月 25 日

發布 androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha06androidx.constraintlayout:constraintlayout-core:1.1.0-alpha061.1.0-alpha06 版本包含以下修訂項目。

新功能

  • 新增 Apis,以 JSON 表示法在 Compose 中啟用格線協助程式,這可將可組合項放置在 2D 格線中(I968ad)。

API 變更

  • 支援在 MotionLayout 中新增弧形向上和弧形向上模式,以及 Arc.AboveArc.Below 方向的獨立弧形模式 (I184a9)
  • 現在可以將基準錨定標記限制為頂端/底部錨定標記,反之亦然。(I54628)。
  • MotionLayoutScope#motionProperties (包括衍生工具) 已重新命名為 MotionLayoutScope#customProperties。這與設定自訂屬性時一致。(Ib34c9)。
  • 現在可以在 ConstraintSetMotionScene 中建立多個參照:val (box, text, button) = createRefsFor("box", "text","button")。使用 constrain(box, button, text) 將限制條件套用至多個元素。在 ConstrainScope 中,您現在可以使用 Dp.asDimension 以直覺化的方式設定固定維度:width = 10.dp.asDimension。(I021ecIa0960)
  • MotionScene()Transition() 方法現在為非可組合函式。這些函式 (包括 ConstraintSet) 中的物件現在應能夠適當地相互比較。ConstraintLayout 中的 animateChanges = true 現在可以只搭配一個 ConstraintSet 參照,只要其任何屬性在重組時有所變更即可。(I7d22e)。

修正錯誤

  • 修正問題:協助程式發生變更時,ConstraintLayout 一律會觸發不必要的多餘重組。(Id83adb/222093277)
  • 修正搭配 ConstraintLayout &使用內建函式時的行為MotionLayout。(I487aeb/220527863)
  • 修正無法在內容變更時重新評估的問題。(Ibfe8ab/219091179)

1.1.0-alpha05 版本

2022 年 12 月 7 日

發布 androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha05androidx.constraintlayout:constraintlayout-core:1.1.0-alpha05查看 1.1.0-alpha05 版的修訂項

新功能

  • 支援 DSL 中的自訂 KeyAttributes (b94e748)
  • ConstrainScope 中的途徑偏誤屬性 (32625d0)
  • 支援鏈結中的自訂參數 (72a2e9e)
  • 在 Compose 中為 MotionLayout 新增 Macrobenchmark 測試 (36f43bc)
  • 如要進一步瞭解先前在 Compose 版本中的變更內容,請參閱維基網頁

API 變更

  • 翻轉 addConstraintSetaddTransition 參數 (152facc)

修正錯誤

1.1.0-alpha01 版本

2022 年 5 月 20 日

發布 androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha01

請注意,MotionLayout API 仍在實驗階段,需要您選擇啟用。

詳情請參閱 GitHub 上的 Compose 1.1.0-alpha01 新功能 一文。

2.2 版

2.2.0-alpha14 版本

2024 年 8 月 7 日

發布 androidx.constraintlayout:constraintlayout:2.2.0-alpha14。2.2.0-alpha14 版包含這些修訂版本

2.2.0-alpha13 版本

2023 年 10 月 4 日

androidx.constraintlayout:constraintlayout:2.2.0-alpha13 發布,內容無變更。查看 2.2.0-alpha13 版的修訂項

2.2.0-alpha12 版

2023 年 8 月 9 日

發布 androidx.constraintlayout:constraintlayout:2.2.0-alpha12查看 2.2.0-alpha12 版的修訂項

2.2.0-alpha11 版

2023 年 7 月 26 日

發布 androidx.constraintlayout:constraintlayout:2.2.0-alpha11查看 2.2.0-alpha11 版的修訂項

API 變更

  • 新增 setter 方法,允許開發人員透過程式輔助方式設定 mInfiniteCarousel 的值 (I0a8ca)

2.2.0-alpha10 版本

2023 年 5 月 24 日

發布 androidx.constraintlayout:constraintlayout:2.2.0-alpha10查看 2.2.0-alpha10 版的修訂項

修正錯誤

  • 修正 MotionLayout 文件的無效連結。(51cbe88)。

2.2.0-alpha09 版本

2023 年 3 月 22 日

發布 androidx.constraintlayout:constraintlayout:2.2.0-alpha09查看 2.2.0-alpha09 版的修訂項

2.2.0-alpha08 版本

2023 年 3 月 8 日

發布 androidx.constraintlayout:constraintlayout:2.2.0-alpha08查看 2.2.0-alpha08 版的修訂項

2.2.0-alpha07 版

2023 年 2 月 8 日

發布 androidx.constraintlayout:constraintlayout:2.2.0-alpha07查看 2.2.0-alpha07 版的修訂項

修正錯誤

  • 修正 ConstraintLayout 網頁內容遺漏的問題(I82e25)。

2.2.0-alpha05 版

2022 年 12 月 7 日

發布 androidx.constraintlayout:constraintlayout:2.2.0-alpha05查看 2.2.0-alpha05 版的修訂項

修正錯誤

  • 修正 View Carousel 中的外洩問題 (eb67b82)

2.2.0-alpha01 版

2022 年 5 月 20 日

發布 androidx.constraintlayout:constraintlayout:2.2.0-alpha01

包含新版 Grid 輔助工具的預覽畫面。

詳情請參閱 GitHub 上的 2.2.0-alpha01 新功能 一文。

ConstraintLayout-compose 1.0

ConstraintLayout-compose 1.0 在 Jetpack Compose 中提供 ConstraintLayout 功能。

1.0.1 版

2022 年 5 月 20 日

發布 androidx.constraintlayout:constraintlayout-compose:1.0.1

請注意,MotionLayout API 仍在實驗階段,需要您選擇啟用。

詳情請參閱 GitHub 上的 Compose 1.0.1 版新功能 一文。

1.0.0 版本

2022 年 1 月 13 日

發布 androidx.constraintlayout:constraintlayout-compose:1.0.0

請注意,MotionLayout API 目前處於實驗階段,必須啟用才能運作。

詳情請參閱 GitHub 的 1.0 版新功能 (Compose) 一文。

1.0.0-rc02 版

2021 年 11 月 16 日

發布 androidx.constraintlayout:constraintlayout-compose:1.0.0-rc02

詳情請參閱 GitHub 的 1.0 版新功能 (Compose) 一文。

1.0.0-rc01 版

2021 年 9 月 27 日

發布 androidx.constraintlayout:constraintlayout-compose:1.0.0-rc01

這個版本為第二個 Beta 版。狀態是功能完整 ConstraintLayoutMotionLayout (適用於 Compose)。

詳情請參閱 GitHub 的 1.0 版新功能 (Compose) 一文。

1.0.0-beta02 版

2021 年 7 月30 日

發布 androidx.constraintlayout:constraintlayout-compose:1.0.0-beta02

這個版本為第二個 Beta 版。狀態是功能完整 ConstraintLayoutMotionLayout (適用於 Compose)。

詳情請參閱 GitHub 的 1.0 版新功能 (Compose) 一文。

1.0.0-beta01 版

2021 年 7 月 22 日

發布 androidx.constraintlayout:constraintlayout-compose:1.0.0-beta01

這個版本為第一個 Beta 版,狀態是功能完整 ConstraintLayoutMotionLayout (適用於 Compose)。

詳情請參閱 GitHub 的 1.0 版新功能 (Compose) 一文。

1.0.0-alpha07 版本

2021 年 5 月 18 日

發布 androidx.constraintlayout:constraintlayout-compose:1.0.0-alpha07

  • 經更新後支援 Compose 1.0.0-beta07 版。

1.0.0-alpha06 版本

2021 年 5 月 4 日

發布 androidx.constraintlayout:constraintlayout-compose:1.0.0-alpha06

  • Compose 最佳化:Constraintlayout 內嵌組件 (#193)
  • 盡量減少在 Compose 中的重新評估 (#210)

1.0.0-alpha05 版本

2021 年 3 月 15 日

發布 androidx.constraintlayout:constraintlayout-compose:1.0.0-alpha05

  • 包含最佳化引擎的修正項目 (b/182657720)
  • 將 optimizationLevel 參數新增至 ConstraintLayout 組件

1.0.0-alpha04 版本

2021 年 3 月 11 日

發布 androidx.constraintlayout:constraintlayout-compose:1.0.0-alpha04

更新為採用最新 constraintlayout-core 引擎

1.0.0-alpha03 版本

2021 年 2 月 24 日

發布 androidx.constraintlayout:constraintlayout-compose:1.0.0-alpha03

Jetpack Compose beta01 版更新

1.0.0-alpha02 版

2021 年 2 月 10 日

發布 androidx.constraintlayout:constraintlayout-compose:1.0.0-alpha02

Jetpack Compose alpha12 版更新

1.0.0-alpha01 版

2021 年 2 月 2 日

發布 androidx.constraintlayout:constraintlayout-compose:1.0.0-alpha01

程式庫的第一個版本,提供內嵌和外部 DSL 來表達限制。

2.1 版

ConstraintLayout 2.1.0 在 MotionLayout 中提供更豐富的功能和全新的輔助工具 (輪轉介面等)

2.1.4 版

2022 年 5 月 20 日

發布 androidx.constraintlayout:constraintlayout:2.1.4

詳情請參閱 GitHub 上的 2.1.4 版新功能 一文。

2.1.3 版

2022 年 1 月 13 日

發布 androidx.constraintlayout:constraintlayout:2.1.3

詳情請參閱 GitHub 文章 2.1 版新功能

2.1.2 版

2021 年 11 月 16 日

發布 androidx.constraintlayout:constraintlayout:2.1.2

詳情請參閱 GitHub 文章 2.1 版新功能

2.1.1 版

2021 年 9 月 27 日

發布 androidx.constraintlayout:constraintlayout:2.1.1

這是 2.1.1 的最終版本。

詳情請參閱 GitHub 文章 2.1 版新功能

2.1.0 版

2021 年 7 月30 日

發布 androidx.constraintlayout:constraintlayout:2.1.0

這是 2.1.0 的最終版本。

詳情請參閱 GitHub 文章 2.1 版新功能

2.1.0-rc01 版

2021 年 7 月 22 日

發布 androidx.constraintlayout:constraintlayout:2.1.0-rc01

這是 2.1.0 版本的候選版本,針對上次的 Beta 版提供小幅改善和修正。詳情請參閱 GitHub 文章 2.1 版新功能

2.1.0-beta02 版

2021 年 5 月 4 日

發布 androidx.constraintlayout:constraintlayout:2.1.0-beta02

MotionLayout 中的幾項新功能:

  • OnSwipe 強化效果,包括 Spring (剛硬、抑制、集結等) 與永不完成
  • jumpToState 函式
  • 在 ViewTransition downUp 模式中輕觸「向下」時,會播放至 100,輕觸「向上」則會還原為 0

修正多項問題,值得注意的有:

  • 修正 MotionLayout 中垂直捲動的問題 (#173)
  • 改善巢狀 MotionLayout 的效能 (#189)
  • 在 MotionLayout 中運用 NestedScrollView 快速轉場 (#189)
  • 在 MotionLayout 中移除 ConstraintSet (#189)
  • 在 MotionLayout 中支援 downUp ViewTransitions (#190)
  • 修正重複使用可繪項目時 ImageFilter 中的內容 (#192)
  • 在 MotionLayout 新增 Spring 支援 (#199)
  • CircularFlow 效能改善 (#200)
  • 修正衍生限制/限制覆寫 (#212)

2.1.0-beta01 版

2021 年 3 月 11 日

發布 androidx.constraintlayout:constraintlayout:2.1.0-beta01

ConstraintLayout

由於發生相容性問題,因此 android:layout_width 和 android:layout_height 變更回非選用項目。

MotionLayout

  • 針對「轉場」支援以程式輔助方式插入及移除 onSWipe 和 onClick
  • 實驗性支援透過畫面旋轉進行「轉場」
  • 針對轉場支援持續時間引數
  • 針對屬於布林值或參考資料的 customAttributes 提供更完善的支援

輔助工具

  • 新增一種方式以透過動畫或跳躍直接前往輪轉介面的特定項目
  • 全新 CircularFlow 輔助工具

查看這個版本的其他資訊 這裡錯誤已關閉

2.1.0-alpha2 版

2020 年 12 月 17 日

發布 androidx.constraintlayout:constraintlayout:2.1.0-alpha2

這是第二個 Alpha 版,新增了幾項功能:

ConstraintLayout

  • android:layout_width 和 android:layout_height 現在為選用項目,預設行為是 wrap_content
  • 新增 layout_constraintWidth 和 layout_constraintHeight 屬性,用於表示尺寸限制
  • 支援使用負數邊界設定限制
  • 支援頂端基準和底端基準限制
  • 支援基準邊界限制
  • SharedValues 可讓您將外部值插入 ConstraintLayout 中

MotionLayout

  • 支援過衝內插器 (預判、過衝)
  • 強化版 MotionHelper 支援
  • 將 ConstraintSet 的動畫式更新新增至 MotionLayout updateStateAnimate(id,cset,duration);
  • 共用以價值為準 ViewTransition
  • scheduleTransitonTo 可讓您安排某個轉場在目前轉場完成後執行。

輔助工具

  • 輪轉介面現已支援無限 (圍繞) 模式
  • ReactiveGuide:SharedValue 變更時會自動安置自身位置的指南
  • MotionAction:將主要畫面格插入至正往指定方向移動的參照檢視畫面
  • MotionLabel - 使單行文字動畫化的檢視畫面

查看這個版本的其他資訊 請按這裡

2.1.0-alpha1 版

2020 年 11 月 19 日

發布 androidx.constraintlayout:constraintlayout:2.1.0-alpha1

2.1 版本的第一個 Alpha 版。開始支援下列項目:

  • 輪轉介面動作輔助工具,用於建立自訂輪轉介面檢視畫面
  • MotionLayout 場景支援納入與限制覆寫
  • MotionLayout 針對旋轉功能新增更多支援 (輸入和輸出)
  • MotionLayout 新增 ViewTransfers,允許針對 constraintsets 的變化進行單一檢視畫面轉場

如要瞭解這個版本的更多資訊,請參閱這裡

2.0 版

ConstraintLayout 2.0 針對版面配置新增功能 (虛擬版面配置等),並針對簡化檢視畫面動畫提供新的類別 MotionLayout。

2.0.4 版

2020 年 10 月 29 日

發布 androidx.constraintlayout:constraintlayout:2.0.4

修正錯誤

這個版本修正了在執行階段移除子項檢視畫面時可能發生的 NPE。建議更新至這個版本。

如要查看已關閉的問題清單,請按這裡

2.0.3 版

2020 年 10 月 27 日

發布 androidx.constraintlayout:constraintlayout:2.0.3

修正錯誤

這個版本修正了一些問題。建議更新至這個版本。

  • Windows 插邊處理
  • 在某些情況中的尺寸比例處理
  • 某些由右至左版面配置當機問題

如要查看已關閉的問題清單,請按這裡

2.0.2 版

2020 年 10 月 6 日

發布 androidx.constraintlayout:constraintlayout:2.0.2

修正錯誤

這個版本可提高效能並修正了一些問題。建議更新至這個版本。

  • 某些情況下,在 ConstraintLayout 中處理檢視 Gone 顯示設定的方式有誤
  • 某些情況下,在 ConstraintLayout 中處理封裝鏈的方式有誤
  • 針對「流程」虛擬版面配置輔助工具修正 API 15 上的加載例外
  • limitBoundsTo 在 MotionLayout 中損毀
  • 某些情況下,MotionLayout 中的跳至結尾功能損毀 (鏈結轉場)

如要查看已關閉的問題清單,請按這裡

2.0.1 版

2020 年 8 月 25 日

發布 androidx.constraintlayout:constraintlayout:2.0.1

此為小幅更新,啟用在 Android Studio 中使用 MotionEditor 的功能。

2.0.0 版

2020 年 8 月 21 日

發布 androidx.constraintlayout:constraintlayout:2.0.0

修正錯誤

如要查看已關閉的問題清單,請按這裡

重要修正項目如下:

  • MotionLayout 轉場延遲和 TransitionListener 修正
  • ConstraintLayout 流程與障礙修正

2.0.0-rc1 版

2020 年 7 月 29 日

發布 androidx.constraintlayout:constraintlayout:2.0.0-rc1

修正錯誤

如要查看已關閉的問題清單,請按這裡

重要修正項目如下:

  • 修正流程
  • RecyclerView 修正 (建議更新到 recyclerview 1.2.0 alpha 5 以上版本)
  • MotionLayout TransitionListener 修正
  • MotionLayout 記憶體外洩修正

2.0.0-beta8 版

2020 年 7 月 7 日

發布 androidx.constraintlayout:constraintlayout:2.0.0-beta8

修正錯誤

如要查看已關閉的問題清單,請按這裡

重要修正項目如下:

  • 預留位置行為
  • 資料層顯示設定
  • 流程、障礙修正
  • TransitionListener 修正

2.0.0-beta7 版

2020 年 6 月 12 日

發布 androidx.constraintlayout:constraintlayout:2.0.0-beta7

修正錯誤

如要查看已關閉的問題清單,請按這裡

重要修正項目如下:

  • MotionLayout 中的巢狀捲動檢視畫面問題
  • MotionLayout 轉場事件監聽器問題
  • MotionLayout 中的記憶體流失問題
  • RecyclerView 問題
  • 群組顯示設定
  • 邊框間距問題

2.0.0-beta6 版

2020 年 5 月 13 日

發布 androidx.constraintlayout:constraintlayout:2.0.0-beta6

修正錯誤

如要查看已關閉的問題清單,請按這裡。重要修正包括 MotionLayout 中的群組顯示設定處理和衍生限制問題。

2.0.0-beta5 版

2020 年 5 月 7 日

發布 androidx.constraintlayout:constraintlayout:2.0.0-beta5

修正錯誤

如要查看已關閉的問題清單,請按這裡

2.0.0-beta4 版

2019 年 12 月 16 日

發布 androidx.constraintlayout:constraintlayout:2.0.0-beta4

新功能

MotionLayout

轉場中的新屬性:

  • layoutDuringTransition:讓您設定 MotionLayout 如何回應子項在轉場期間的 requestLayouts 呼叫。可能的值為 {ignoreRequest, honorRequest}
  • pathMotionArc:元素移動時採用的路徑會使用弧形。可能的值為 {startVertical | startHorizontal | flip | none }

現在可藉由省略起始和結束 ConstraintSet 的方式,定義預設轉場效果。如果沒有符合目前開始/結束狀態的其他現有轉場,系統就會採用預設轉場。

修正錯誤

如要查看已關閉的問題清單,請按這裡