{"id":113408,"date":"2026-10-06T09:40:52","date_gmt":"2026-10-06T01:40:52","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/113408.html"},"modified":"2026-10-06T09:40:52","modified_gmt":"2026-10-06T01:40:52","slug":"swiftui-ui-patterns-list","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/113408.html","title":{"rendered":"swiftui-ui-patterns - list"},"content":{"rendered":"<h2>\u5217\u8868\u4e0e\u5206\u533a&#xff08;List and Section&#xff09;<\/h2>\n<h3>\u610f\u56fe<\/h3>\n<p>\u5bf9\u4e8e\u4fe1\u606f\u6d41\u5f0f\u5185\u5bb9\u548c\u8bbe\u7f6e\u98ce\u683c\u7684\u884c&#xff0c;\u4f7f\u7528 List&#xff0c;\u6b64\u65f6\u5185\u7f6e\u7684\u884c\u590d\u7528\u3001\u9009\u62e9\u548c\u53ef\u8bbf\u95ee\u6027\u5f88\u91cd\u8981\u3002<\/p>\n<h3>\u6838\u5fc3\u6a21\u5f0f<\/h3>\n<ul>\n<li>\u5bf9\u5e26\u6709\u91cd\u590d\u884c\u7684\u957f\u5782\u76f4\u6eda\u52a8\u5185\u5bb9&#xff0c;\u4f18\u5148\u4f7f\u7528 List\u3002<\/li>\n<li>\u4f7f\u7528 Section \u6807\u9898\u5bf9\u76f8\u5173\u884c\u5206\u7ec4\u3002<\/li>\n<li>\u9700\u8981\u6eda\u52a8\u5230\u9876\u90e8\u6216\u8df3\u8f6c\u5230\u6307\u5b9a id \u65f6&#xff0c;\u914d\u5408 ScrollViewReader\u3002<\/li>\n<li>\u5bf9\u73b0\u4ee3\u4fe1\u606f\u6d41\u5e03\u5c40\u4f7f\u7528 .listStyle(.plain)\u3002<\/li>\n<li>\u5bf9\u5206\u533a\u5206\u7ec4\u6709\u5e2e\u52a9\u7684\u591a\u5206\u533a\u53d1\u73b0\/\u641c\u7d22\u9875&#xff0c;\u4f7f\u7528 .listStyle(.grouped)\u3002<\/li>\n<li>\u9700\u8981\u4e3b\u9898\u5316\u8868\u9762\u65f6&#xff0c;\u5e94\u7528 .scrollContentBackground(.hidden) &#043; \u81ea\u5b9a\u4e49\u80cc\u666f\u3002<\/li>\n<li>\u4f7f\u7528 .listRowInsets(&#8230;) \u548c .listRowSeparator(.hidden) \u8c03\u6574\u884c\u95f4\u8ddd\u548c\u5206\u9694\u7ebf\u3002<\/li>\n<li>\u4f7f\u7528 .environment(\\\\\\\\.defaultMinListRowHeight, &#8230;) \u63a7\u5236\u7d27\u51d1\u5217\u8868\u5e03\u5c40\u3002<\/li>\n<\/ul>\n<h3>\u793a\u4f8b&#xff1a;\u5e26\u6eda\u52a8\u5230\u9876\u90e8\u7684\u4fe1\u606f\u6d41\u5217\u8868<\/h3>\n<p><span class=\"token attribute atrule\">&#064;MainActor<\/span><br \/>\n<span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">TimelineListView<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token class-name\">View<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token attribute atrule\">&#064;Environment<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">\\\\<\/span><span class=\"token punctuation\">.<\/span>selectedTabScrollToTop<span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">private<\/span> <span class=\"token keyword\">var<\/span> selectedTabScrollToTop<br \/>\n  <span class=\"token attribute atrule\">&#064;State<\/span> <span class=\"token keyword\">private<\/span> <span class=\"token keyword\">var<\/span> scrollToId<span class=\"token punctuation\">:<\/span> <span class=\"token class-name\">String<\/span><span class=\"token operator\">?<\/span><\/p>\n<p>  <span class=\"token keyword\">var<\/span> body<span class=\"token punctuation\">:<\/span> <span class=\"token keyword\">some<\/span> <span class=\"token class-name\">View<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token class-name\">ScrollViewReader<\/span> <span class=\"token punctuation\">{<\/span> proxy <span class=\"token keyword\">in<\/span><br \/>\n      <span class=\"token class-name\">List<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token class-name\">ForEach<\/span><span class=\"token punctuation\">(<\/span>items<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span> item <span class=\"token keyword\">in<\/span><br \/>\n          <span class=\"token class-name\">TimelineRow<\/span><span class=\"token punctuation\">(<\/span>item<span class=\"token punctuation\">:<\/span> item<span class=\"token punctuation\">)<\/span><br \/>\n            <span class=\"token punctuation\">.<\/span><span class=\"token function\">id<\/span><span class=\"token punctuation\">(<\/span>item<span class=\"token punctuation\">.<\/span>id<span class=\"token punctuation\">)<\/span><br \/>\n            <span class=\"token punctuation\">.<\/span><span class=\"token function\">listRowInsets<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">.<\/span><span class=\"token keyword\">init<\/span><span class=\"token punctuation\">(<\/span>top<span class=\"token punctuation\">:<\/span> <span class=\"token number\">12<\/span><span class=\"token punctuation\">,<\/span> leading<span class=\"token punctuation\">:<\/span> <span class=\"token number\">16<\/span><span class=\"token punctuation\">,<\/span> bottom<span class=\"token punctuation\">:<\/span> <span class=\"token number\">6<\/span><span class=\"token punctuation\">,<\/span> trailing<span class=\"token punctuation\">:<\/span> <span class=\"token number\">16<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n            <span class=\"token punctuation\">.<\/span><span class=\"token function\">listRowSeparator<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">.<\/span>hidden<span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n      <span class=\"token punctuation\">}<\/span><br \/>\n      <span class=\"token punctuation\">.<\/span><span class=\"token function\">listStyle<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">.<\/span>plain<span class=\"token punctuation\">)<\/span><br \/>\n      <span class=\"token punctuation\">.<\/span><span class=\"token function\">environment<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">\\\\<\/span><span class=\"token punctuation\">\\\\<\/span><span class=\"token punctuation\">.<\/span>defaultMinListRowHeight<span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><br \/>\n      <span class=\"token punctuation\">.<\/span><span class=\"token function\">onChange<\/span><span class=\"token punctuation\">(<\/span>of<span class=\"token punctuation\">:<\/span> scrollToId<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token omit keyword\">_<\/span><span class=\"token punctuation\">,<\/span> newValue <span class=\"token keyword\">in<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> <span class=\"token keyword\">let<\/span> newValue <span class=\"token punctuation\">{<\/span><br \/>\n          proxy<span class=\"token punctuation\">.<\/span><span class=\"token function\">scrollTo<\/span><span class=\"token punctuation\">(<\/span>newValue<span class=\"token punctuation\">,<\/span> anchor<span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">.<\/span>top<span class=\"token punctuation\">)<\/span><br \/>\n          scrollToId <span class=\"token operator\">&#061;<\/span> <span class=\"token nil constant\">nil<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n      <span class=\"token punctuation\">}<\/span><br \/>\n      <span class=\"token punctuation\">.<\/span><span class=\"token function\">onChange<\/span><span class=\"token punctuation\">(<\/span>of<span class=\"token punctuation\">:<\/span> selectedTabScrollToTop<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token omit keyword\">_<\/span><span class=\"token punctuation\">,<\/span> newValue <span class=\"token keyword\">in<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> newValue <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token number\">0<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n          withAnimation <span class=\"token punctuation\">{<\/span><br \/>\n            proxy<span class=\"token punctuation\">.<\/span><span class=\"token function\">scrollTo<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">ScrollToView<\/span><span class=\"token punctuation\">.<\/span><span class=\"token class-name\">Constants<\/span><span class=\"token punctuation\">.<\/span>scrollToTop<span class=\"token punctuation\">,<\/span> anchor<span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">.<\/span>top<span class=\"token punctuation\">)<\/span><br \/>\n          <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n      <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h3>\u793a\u4f8b&#xff1a;\u8bbe\u7f6e\u98ce\u683c\u5217\u8868<\/h3>\n<p><span class=\"token attribute atrule\">&#064;MainActor<\/span><br \/>\n<span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">SettingsView<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token class-name\">View<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token keyword\">var<\/span> body<span class=\"token punctuation\">:<\/span> <span class=\"token keyword\">some<\/span> <span class=\"token class-name\">View<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token class-name\">List<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n      <span class=\"token class-name\">Section<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-literal\"><span class=\"token string\">&#034;General&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token class-name\">NavigationLink<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-literal\"><span class=\"token string\">&#034;Display&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token class-name\">DisplaySettingsView<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token class-name\">NavigationLink<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-literal\"><span class=\"token string\">&#034;Haptics&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span> <span class=\"token class-name\">HapticsSettingsView<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">}<\/span><br \/>\n      <span class=\"token punctuation\">}<\/span><br \/>\n      <span class=\"token class-name\">Section<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-literal\"><span class=\"token string\">&#034;Account&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token class-name\">Button<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-literal\"><span class=\"token string\">&#034;Sign Out&#034;<\/span><\/span><span class=\"token punctuation\">,<\/span> role<span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">.<\/span>destructive<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">}<\/span><br \/>\n      <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span><span class=\"token function\">listStyle<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">.<\/span>insetGrouped<span class=\"token punctuation\">)<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h3>\u5e94\u4fdd\u7559\u7684\u8bbe\u8ba1\u9009\u62e9<\/h3>\n<ul>\n<li>\u5bf9\u52a8\u6001\u4fe1\u606f\u6d41\u3001\u8bbe\u7f6e\u4ee5\u53ca\u4efb\u4f55\u884c\u8bed\u4e49\u6709\u5e2e\u52a9\u7684 UI \u4f7f\u7528 List\u3002<\/li>\n<li>\u4e3a\u884c\u4f7f\u7528\u7a33\u5b9a\u7684 ID&#xff0c;\u4ee5\u4fdd\u6301\u52a8\u753b\u548c\u6eda\u52a8\u5b9a\u4f4d\u53ef\u9760\u3002<\/li>\n<li>\u5bf9\u5e94\u5f53\u6574\u884c\u53ef\u70b9\u51fb\u7684\u884c&#xff0c;\u4f18\u5148\u4f7f\u7528 .contentShape(Rectangle())\u3002<\/li>\n<li>\u5f53\u6570\u636e\u6e90\u652f\u6301\u65f6&#xff0c;\u5bf9\u4e0b\u62c9\u5237\u65b0\u4fe1\u606f\u6d41\u4f7f\u7528 .refreshable\u3002<\/li>\n<\/ul>\n<h3>\u9677\u9631<\/h3>\n<ul>\n<li>\u907f\u514d\u5728 List \u884c\u5185\u4f7f\u7528\u91cd\u578b\u81ea\u5b9a\u4e49\u5e03\u5c40&#xff1b;\u6539\u7528 ScrollView &#043; LazyVStack\u3002<\/li>\n<li>\u5c0f\u5fc3\u6df7\u7528 List \u548c\u5d4c\u5957\u7684 ScrollView&#xff1b;\u53ef\u80fd\u5bfc\u81f4\u624b\u52bf\u51b2\u7a81\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5217\u8868\u4e0e\u5206\u533a&#xff08;List and Section&#xff09;<br \/>\n\u610f\u56fe<br \/>\n\u5bf9\u4e8e\u4fe1\u606f\u6d41\u5f0f\u5185\u5bb9\u548c\u8bbe\u7f6e\u98ce\u683c\u7684\u884c&#xff0c;\u4f7f\u7528 List&#xff0c;\u6b64\u65f6\u5185\u7f6e\u7684\u884c\u590d\u7528\u3001\u9009\u62e9\u548c\u53ef\u8bbf\u95ee\u6027\u5f88\u91cd\u8981\u3002<br \/>\n\u6838\u5fc3\u6a21\u5f0f<br \/>\n\u5bf9\u5e26\u6709\u91cd\u590d\u884c\u7684\u957f\u5782\u76f4\u6eda\u52a8\u5185\u5bb9&#xff0c;\u4f18\u5148\u4f7f\u7528 List\u3002\u4f7f\u7528 Section \u6807\u9898\u5bf9\u76f8\u5173\u884c\u5206\u7ec4\u3002\u9700\u8981\u6eda\u52a8\u5230\u9876\u90e8\u6216\u8df3\u8f6c\u5230\u6307\u5b9a id \u65f6&#xff0c;\u914d\u5408 ScrollViewReader\u3002\u5bf9\u73b0\u4ee3\u4fe1\u606f\u6d41\u5e03\u5c40\u4f7f\u7528 .listStyle(.plain)\u3002\u5bf9\u5206\u533a\u5206\u7ec4\u6709\u5e2e<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1680,5814,780],"topic":[],"class_list":["post-113408","post","type-post","status-publish","format-standard","hentry","category-server","tag-ios","tag-swiftui","tag-ui"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>swiftui-ui-patterns - list - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/113408.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"swiftui-ui-patterns - list - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5217\u8868\u4e0e\u5206\u533a&#xff08;List and Section&#xff09; \u610f\u56fe \u5bf9\u4e8e\u4fe1\u606f\u6d41\u5f0f\u5185\u5bb9\u548c\u8bbe\u7f6e\u98ce\u683c\u7684\u884c&#xff0c;\u4f7f\u7528 List&#xff0c;\u6b64\u65f6\u5185\u7f6e\u7684\u884c\u590d\u7528\u3001\u9009\u62e9\u548c\u53ef\u8bbf\u95ee\u6027\u5f88\u91cd\u8981\u3002 \u6838\u5fc3\u6a21\u5f0f \u5bf9\u5e26\u6709\u91cd\u590d\u884c\u7684\u957f\u5782\u76f4\u6eda\u52a8\u5185\u5bb9&#xff0c;\u4f18\u5148\u4f7f\u7528 List\u3002\u4f7f\u7528 Section \u6807\u9898\u5bf9\u76f8\u5173\u884c\u5206\u7ec4\u3002\u9700\u8981\u6eda\u52a8\u5230\u9876\u90e8\u6216\u8df3\u8f6c\u5230\u6307\u5b9a id \u65f6&#xff0c;\u914d\u5408 ScrollViewReader\u3002\u5bf9\u73b0\u4ee3\u4fe1\u606f\u6d41\u5e03\u5c40\u4f7f\u7528 .listStyle(.plain)\u3002\u5bf9\u5206\u533a\u5206\u7ec4\u6709\u5e2e\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/113408.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-06T01:40:52+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/113408.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/113408.html\",\"name\":\"swiftui-ui-patterns - list - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-06T01:40:52+00:00\",\"dateModified\":\"2026-10-06T01:40:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/113408.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/113408.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/113408.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"swiftui-ui-patterns - list\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"swiftui-ui-patterns - list - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/113408.html","og_locale":"zh_CN","og_type":"article","og_title":"swiftui-ui-patterns - list - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5217\u8868\u4e0e\u5206\u533a&#xff08;List and Section&#xff09; \u610f\u56fe \u5bf9\u4e8e\u4fe1\u606f\u6d41\u5f0f\u5185\u5bb9\u548c\u8bbe\u7f6e\u98ce\u683c\u7684\u884c&#xff0c;\u4f7f\u7528 List&#xff0c;\u6b64\u65f6\u5185\u7f6e\u7684\u884c\u590d\u7528\u3001\u9009\u62e9\u548c\u53ef\u8bbf\u95ee\u6027\u5f88\u91cd\u8981\u3002 \u6838\u5fc3\u6a21\u5f0f \u5bf9\u5e26\u6709\u91cd\u590d\u884c\u7684\u957f\u5782\u76f4\u6eda\u52a8\u5185\u5bb9&#xff0c;\u4f18\u5148\u4f7f\u7528 List\u3002\u4f7f\u7528 Section \u6807\u9898\u5bf9\u76f8\u5173\u884c\u5206\u7ec4\u3002\u9700\u8981\u6eda\u52a8\u5230\u9876\u90e8\u6216\u8df3\u8f6c\u5230\u6307\u5b9a id \u65f6&#xff0c;\u914d\u5408 ScrollViewReader\u3002\u5bf9\u73b0\u4ee3\u4fe1\u606f\u6d41\u5e03\u5c40\u4f7f\u7528 .listStyle(.plain)\u3002\u5bf9\u5206\u533a\u5206\u7ec4\u6709\u5e2e","og_url":"https:\/\/www.wsisp.com\/helps\/113408.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-06T01:40:52+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/113408.html","url":"https:\/\/www.wsisp.com\/helps\/113408.html","name":"swiftui-ui-patterns - list - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-06T01:40:52+00:00","dateModified":"2026-10-06T01:40:52+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/113408.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/113408.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/113408.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"swiftui-ui-patterns - list"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/113408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=113408"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/113408\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=113408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=113408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=113408"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=113408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}