> For the complete documentation index, see [llms.txt](https://ryukiedev.gitbook.io/wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ryukiedev.gitbook.io/wiki/swiftui/01.form.md).

# 01.Form

`Form`相较于`List`更适合用于类似设置页面这样的场景 下面的图和代码可以直观感受一下

## 01.Form预览

![List](/files/-MUpQnXFPHuvjUWiAbgT) ![List](/files/-MUpQnXJ2A5mnZqNpxbe)

## 02.List预览

![List](/files/-MUpQnXKpWSn4R3d0WlM) ![List](/files/-MUpQnXLZUPsuS0Nl6ap)

## 03.List Group 预览

![List](/files/-MUpQnXMOh-1NpGPQ_wn) ![List](/files/-MUpQnXNa9o2Hb_D3XcU)

## 04.修改背景色

想要修改`Form`的背景色，第一反应会这样写：

```swift
Form {
    Section {
        Text("VIP")
    }

    Section {
        Text("Coin")
    }
}
.background(Color.red)
.scaledToFill()
```

然鹅并没有效果 ![1](/files/-MUwMtC44_5P3pi7rjBQ)

### 为什么呢？

实际上`Form`是基于`TableView`的。 这里需要进行以下操作：

```swift
init() {
        UITableView.appearance().backgroundColor = .clear
    }
```

![2](/files/-MUwMtC6nlSVlMxr21FT)

## 05.隐藏滑块

依旧需要通过`UITableView`实现，可见现在`SwiftUI`完成度还不高。 总是通过使用`UIKit`来进行一些常用属性的设置。

```swift
init() {
        UITableView.appearance().showsVerticalScrollIndicator = false
    }
```
