Swift on Xcode#14[NestedStackView]

--

繼上一篇最簡單的StackView,這邊要提的就是巢狀(Nested)的堆疊視圖(StackView)

前言

巢狀的堆疊視圖其實要說起來也沒有什麼,就是把之前創的所有東西都丟在外面設定的視圖一起放而已。

正文

從我的程式碼可以看到,內部的StackView,有label1、label2、label3三個東西在裡面。

全部的stackView則在第72行裡面把label5、labe4當作夾心餅乾,讓他們把upperStackView夾在裡面了:

成品如下:

轉成橫向:

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

影山小麥機
影山小麥機

Written by 影山小麥機

本職為Mobile工程師,熱愛分享視野,也樂意站在ChatGPT的肩膀上。訂閱小麥機,收割技術、職涯、人生的難題。

No responses yet

Write a response