We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
トビさんと Twitter でお話しした際に出た Effective な項目です。
可読性もそうですが、複数の View について異なるAlignment を貼りたい場合など、ZStack ではかなり面倒になったりします。(たぶん一度遭遇すれば納得できるかと思います
ZStack を使いたいとなるのは、 zIndex を使いたいケースや、ベースとなる View の frame に縛られないようにしたいケースだけだと、現時点では考えていますー
zIndex
The text was updated successfully, but these errors were encountered:
.overlay を3つくらい重ねたいケースが出てきたのですが、それは ZStack を使ったほうがいいのでしょうか…? もしくは1つの .overlay で実現できる…?
.overlay
ZStack
Sorry, something went wrong.
.overlayも.backgroundもいくらでも重ねがけできるので、基本的にはZStackは使わなくても大丈夫かと思います(たぶん... https://www.swiftbysundell.com/articles/backgrounds-and-overlays-in-swiftui/
.background
どういう UI なのかによりますが、もしかしたら ZStack で面倒なケースに当たるのでは、と思います。(よろしければぜひ試されてください 🙏
複数の View について異なるAlignment を貼りたい場合など、ZStack ではかなり面倒になったりします。
おお…まさに自分の知りたいことが書いてありました😭 .overlay はいくら重ねがけしても問題なさそうですね、ありがとうございますー!
No branches or pull requests
トビさんと Twitter でお話しした際に出た Effective な項目です。
References
The text was updated successfully, but these errors were encountered: