LoginSignup
3
7

More than 5 years have passed since last update.

【Swift3】UITabBarのItemの画像をStoryboardで設定

Last updated at Posted at 2017-09-07

はじめに

UITabBarのItemに画像をStoryBoard上で設定するやり方を記述していきたいと思います

準備

  • 画像用意(moon.png)

moon.png

  • UITabBarControllerを用意

tab.png

手順

1.Tab Bar Item 設定

  • System Itemの部分をCustomに変更
  • Selected Imageの部分を任意の画像に変更

1.png

しかしこのままでは、うまく反映されません

iPhone1.png

2.Bar Item 設定

  • Imageを先ほどの画像に変更

4.png

これで、無事反映されます

ここの設定を忘れていて、僕は割と詰まってしまいました...

iPhone2.png

おわりに

コードで設定するのもいいけど、できればStoryboardで出来るものはやりたいなぁ
と最近思ってます(笑)

今回のサンプルコードはこちらにあります

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