1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

SwiftUIのList 下から上にしたいよね、わかります。

Posted at

SwiftUIのlistは普段は上から下にrowが追加されていき、下の方のrowを見るためにはスクロールダウンする必要がありますよね。
ただ、親指の届きやすい画面下部にviewを集めたいときなど、この仕様を変えたいときがあると思います。
以下のようにすると下から上にrowが追加されていきます。

List{
                    ForEach(/*...*/){
                        //...
                    }.rotationEffect(Angle(degrees: 180))
              } .rotationEffect(Angle(degrees: 180))


まずはlist全体を上下逆さにして、その後各rowを上下逆さにしていますね。

参考:
https://stackoverflow.com/questions/65384646/swiftui-build-view-from-bottom-alignment-in-scrollview

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?