LoginSignup
0
0

More than 1 year has passed since last update.

【Swift】ハーフモーダルをライブラリなしで作る

Posted at

実装方法

UIModalPresentationStyleを使う

遷移元のViewControllerからハーフモーダル用のViewControllerへ、Segueを繋ぐ

Kind は Present Modallyを選択する
Screen Shot 2022-03-18 at 19.09.05.png

画面の上部の透過部分

ハーフモーダル用のViewControllerはViewのBackground を Clear Color とする
Screen Shot 2022-03-18 at 19.08.22.png

ハーフモーダル部分

HeightはSafeAreaに対して、0.65の比率を指定しました。
Screen Shot 2022-03-18 at 19.07.51.png

これで、ハーフモーダルビューの完成。

0
0
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
0
0