LoginSignup
0
0

More than 3 years have passed since last update.

備忘録)AndroidStudio)BottomNavigationViewチュートリアル

Last updated at Posted at 2019-12-24

環境

android studio 3.2
windows 10

完成サンプル

btmNavTutGif.gif

フォルダ構成

github

準備

Bottom Navigation View をつかうために build.gradleに

build.gradle
implementation 'com.google.android.material:material:1.2.0-alpha02'

を追加

追加したファイル一覧

  • app>src>main>res>layout

    • fragment_favorites
    • fragment_home
    • fragment_profile
  • app>src>main>res>menu ※1

    • bottom_nav
  • app>src>main>res>drawable ※2

    • ic_favorite_black_24dp
    • ic_home_black_24dp
    • ic_person_black_24dp
  • app>src>main>java>com.tainiko.bottomnavigationtutorial ※3

    • FavoritesFragment
    • HomeFragment
    • ProfileFragment
補足

※1
menuの作り方
   resを右クリック>New>Android Resource Directory>Android Resource Directory>Resource Type>menuを選択

※2
アイコンの追加
   drawable右クリック>New>VectorAsset>clip artクリック>好きな画像選択

※3
Fragmentの追加
   パケージ名(com.tainiko.bottomnavigationtutorial)右クリック>New>Fragment>Fragment(blank)

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