func padding(CGFloat) -> some View
func padding(Edge.Set, CGFloat?) -> some View
func padding(EdgeInsets ) -> some View
func scenePadding (Edge.Set) -> some View
Availability 有効性
Technology
func listRowInsets(_ insets: EdgeInsets
?) -> some View
A view that uses the given edge insets when used as a list cell. あるビュー、それはあるリストセルが使われる時にこの与えられた縁差込を使用するものです。
insets
The Edge
to apply to the edges of the view.
Use list
to change the default padding of the content of list items.
list
使用して、リスト項目の内容の省略時の詰めものを変更してください。
In the example below, the Flavor
enumeration provides content for list items.
下の例において、Flavor
列挙はリスト項目それらに対する内容を提供します。
The SwiftUI For
structure computes views for each element of the Flavor
enumeration and extracts the raw value of each of its elements using the resulting text to create each list row item. The list
modifier then changes the edge insets of each row of the list according to the Edge
provided:
struct ContentView: View {
enum Flavor: String, CaseIterable, Identifiable {
var id: String { self.rawValue }
case vanilla, chocolate, strawberry
}
var body: some View {
List {
ForEach(Flavor.allCases) {
Text($0.rawValue)
.listRowInsets(.init(top: 0,
leading: 25,
bottom: 0,
trailing: 0))
}
}
}
}
func padding(CGFloat) -> some View
func padding(Edge.Set, CGFloat?) -> some View
func padding(EdgeInsets ) -> some View
func scenePadding (Edge.Set) -> some View