3
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 3 years have passed since last update.

【SwiftUI】iOS15から使用できるmenuIndicatorについて調べた

3
Posted at

はじめに

menuIndicatorというモディファイアがサジェストに出てきて気になったので調べてみました。

何ができるものか

下向きの矢印を表示するかしないかの指定ができます。
スクリーンショット 2023-04-27 17.27.46.png

表示しない場合は以下のようになります。
スクリーンショット 2023-04-27 17.29.18.png

使い方

自動

Menu {
    Button("サンプル1") {}
    Button("サンプル2") {}
    Button("サンプル3") {}
    Button("サンプル4") {}
    Button("サンプル5") {}
} label: {
    Text("メニュー")
}
.menuIndicator(.automatic)

表示

Menu {
    Button("サンプル1") {}
    Button("サンプル2") {}
    Button("サンプル3") {}
    Button("サンプル4") {}
    Button("サンプル5") {}
} label: {
    Text("メニュー")
}
.menuIndicator(.visible)

非表示

Menu {
    Button("サンプル1") {}
    Button("サンプル2") {}
    Button("サンプル3") {}
    Button("サンプル4") {}
    Button("サンプル5") {}
} label: {
    Text("メニュー")
}
.menuIndicator(.hidden)

おわり

他にも知らない機能がいっぱいありそうなので調査していきます。

3
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
3
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?