技術文章
技術問答
iT 徵才
聊天室
2026 鐵人賽
登入/註冊
文章
問答
Tag
邦友
鐵人賽
搜尋
2021 iThome 鐵人賽
DAY
24
0
Mobile Development
麻瓜學習 iOS 開發
系列 第
24
篇
Day24:使i用 ForEach、ScrollView 構建 UI
13th鐵人賽
enolazxy
2021-10-09 23:51:19
743 瀏覽
分享至
前言
上篇文章講了加數據進去,
今天來刻 UI。
實作
添加一些 image 進去 asset:
在 app 主頁面中將 image 和 text 並排顯示:
新增一個 RecipeDetailView file:
宣告變數 recipe 符合 class Recipe 的數據類型
建構 UI
用 ForEach 遍歷 recipe 中的 ingredients、directions 數組,
canvas 顯示:
再用一個 VStack 包住所有元素:
留言
追蹤
檢舉
上一篇
Day23:傳入 JSON 文件
下一篇
Day25:NavigationView
系列文
麻瓜學習 iOS 開發
共
30
篇
目錄
RSS系列文
訂閱系列文
2
人訂閱
26
Day26:TabView
27
Day27:用 EnvironmentObject 傳遞數據
28
Day28:Update the Data and the Featured View
29
Day29: Picker controller
30
Day 30 : DetailView
完整目錄
熱門推薦
{{ item.subject }}
{{ item.channelVendor }}
|
{{ item.webinarstarted }}
|
{{ formatDate(item.duration) }}
直播中
立即報名
尚未有邦友留言
立即登入留言
iThome鐵人賽
參賽組數
902
組
團體組數
37
組
累計文章數
19837
篇
完賽人數
528
人
看影片追技術
看更多
{{ item.subject }}
{{ item.channelVendor }}
|
{{ formatDate(item.duration) }}
直播中
熱門tag
15th鐵人賽
16th鐵人賽
13th鐵人賽
14th鐵人賽
17th鐵人賽
12th鐵人賽
11th鐵人賽
鐵人賽
2019鐵人賽
javascript
2018鐵人賽
python
2017鐵人賽
windows
php
c#
linux
windows server
css
react
熱門問題
有人願意割愛Microsoft SQL Server Reporting Services報表服務 書嗎?
請益演算法市面推薦書籍
熱門回答
請益演算法市面推薦書籍
有人願意割愛Microsoft SQL Server Reporting Services報表服務 書嗎?
熱門文章
Claude code 新手篇 1 : Claude Code 從零開始 — 我用它把個人網站從企業官網風格改成雜誌風格
用 LINE Flex Message 打造「企業電子薪資單」與「汽車 OMO 保養報告」的萬無一失架構
黃仁勳說了哪些重點?NVIDIA GTC Taipei 2026 完整懶人包
別跟 AI 浪潮硬碰硬,Dell 財報把話說白了
檔案比對這件事,做對工具差很多 — — Beyond Compare 介紹
IT邦幫忙
×
標記使用者
輸入對方的帳號或暱稱
Loading
找不到結果。
標記
{{ result.label }}
{{ result.account }}