7
5

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

SwiftUIでtabItemのSF Symbolsのサイズを変更する方法

Last updated at Posted at 2019-11-24

SwiftUI tips

SwiftUIでタブのアイテムのサイズを変更するのに少し苦戦したので共有します。
なお、大きくしたアイコンがtabの一番上に付いていてpaddingも効かないのでご了承🙇‍♂️
(解決策あったら米キボンヌ)

成功するパターン

Text("user")
	.tabItem {
		Image(systemName: "person")
			.font(.title)
		}
.tag(4)
.font(.system(size: 10))//とかでも行ける
IMG_0335.png

ダメなパターン

Text("user")
	.tabItem {
		Image(systemName: "person")
			.resizable()
			.aspectRatio(contentMode: .fit)
			.frame(width: tabItemSize, height: tabItemSize)
		}
.tag(4)
IMG_0334.png

参考URL

7
5
2

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?