技術文章
技術問答
My Project
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
816 瀏覽
分享至
前言
上篇文章講了加數據進去,
今天來刻 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鐵人賽
參賽組數
929
組
團體組數
32
組
累計文章數
20368
篇
完賽人數
534
人
看影片追技術
看更多
{{ item.subject }}
{{ item.channelVendor }}
|
{{ formatDate(item.duration) }}
直播中
熱門tag
15th鐵人賽
16th鐵人賽
13th鐵人賽
18th鐵人賽
17th鐵人賽
14th鐵人賽
12th鐵人賽
11th鐵人賽
鐵人賽
2019鐵人賽
javascript
2018鐵人賽
python
2017鐵人賽
windows
php
c#
linux
windows server
css
熱門問題
熱門回答
熱門文章
Line JP LY 通話錄音,電話錄音,影像通話錄音, LINE Lab
如何用 AI 準備軟體工程師面試
Claude Code Agent Skills 的 allowed-tools 不是工具限制:SKILL.md 權限欄位的誤解、來由與正確用法
Day 13:Streamlit 入門——建立第一個互動式網頁
Day 14:健康紀錄表單設計——輸入每日生活習慣
IT邦幫忙
×
標記使用者
輸入對方的帳號或暱稱
Loading
找不到結果。
標記
{{ result.label }}
{{ result.account }}