ConstraintLayout Circular positioning 圓形定位

更新於 發佈於 閱讀時間約 4 分鐘
【Android 入門指南】系列文章目錄:https://bit.ly/3TFgCzu
Android 線上課程教學影片:https://bit.ly/433Offj

課程摘要

本課程學習如何使用 ConstraintLayout 約束佈局中的 Circular positioning 圓形定位。

教學影片

若您無法順利觀看教學影片,請先登入您的 YouTube 帳號,然後點擊以下連結加入我們的頻道會員:

  • 一般會員:成為一般會員後,您將能夠觀看我們所提供的一般會員專屬線上課程。
  • 精實會員:成為精實會員後,您將能夠觀看我們所提供的精實會員專屬線上課程。

程式碼範例

範例名稱:ConstraintLayout Circular positioning 圓形定位
作者:HKT (侯光燦)
授權範圍:使用時必須註明出處且不得為商業目的之使用
範例下載點:點我下載


activity_main.xml

<androidx.constraintlayout.widget.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=".MainActivity">

<Button
android:id="@+id/centerButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="中心"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />


<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="按鈕1"
app:layout_constraintCircle="@id/centerButton"
app:layout_constraintCircleAngle="45"
app:layout_constraintCircleRadius="100dp" />

</androidx.constraintlayout.widget.ConstraintLayout>
avatar-img
15會員
261內容數
哈囉!歡迎光臨我的沙龍!我是 KT,一位對應用程式開發充滿熱情的開發者。在這個專屬空間,我將與您分享我在應用開發領域的深入學習心得和豐富的實戰經驗。如果您對應用程式開發技術同樣充滿好奇,渴望不斷探索新知,歡迎成為我們的會員,一起在應用程式開發的旅途上,探索更深層次的技術世界,享受學習的樂趣。
留言
avatar-img
留言分享你的想法!

































































HKT實驗室 的其他內容
本課程學習如何使用 ConstraintLayout 約束佈局中的 Guideline 導覽線。
本課程學習如何使用 ConstraintLayout 約束佈局中的 Bias 偏移屬性。
本課程學習如何使用 ConstraintLayout 約束佈局中的 Chains 鏈結屬性。
本課程學習如何使用 ConstraintLayout 約束佈局中的 Margin 邊距屬性。
本課程學習如何轉換 ConstraintLayout 提升效能優化佈局指南。
本課程學習 ConstraintLayout 約束佈局實戰練習。
本課程學習如何使用 ConstraintLayout 約束佈局中的 Guideline 導覽線。
本課程學習如何使用 ConstraintLayout 約束佈局中的 Bias 偏移屬性。
本課程學習如何使用 ConstraintLayout 約束佈局中的 Chains 鏈結屬性。
本課程學習如何使用 ConstraintLayout 約束佈局中的 Margin 邊距屬性。
本課程學習如何轉換 ConstraintLayout 提升效能優化佈局指南。
本課程學習 ConstraintLayout 約束佈局實戰練習。
你可能也想看
Google News 追蹤
本課程學習如何使用 ConstraintLayout 約束佈局中的 Circular positioning 圓形定位。
本課程學習如何使用 ConstraintLayout 約束佈局中的 Guideline 導覽線。
本課程學習如何使用 ConstraintLayout 約束佈局中的 Bias 偏移屬性。
本課程學習如何使用 ConstraintLayout 約束佈局中的 Chains 鏈結屬性。
本課程學習如何使用 ConstraintLayout 約束佈局中的 Margin 邊距屬性。
本課程學習如何使用 ConstraintLayout 約束佈局中的 Circular positioning 圓形定位。
本課程學習如何使用 ConstraintLayout 約束佈局中的 Guideline 導覽線。
本課程學習如何使用 ConstraintLayout 約束佈局中的 Bias 偏移屬性。
本課程學習如何使用 ConstraintLayout 約束佈局中的 Chains 鏈結屬性。
本課程學習如何使用 ConstraintLayout 約束佈局中的 Margin 邊距屬性。