Bottom Navigation View
dependencies { implementation ‘com.google.android.material:material:1.1.0’ } drawable 디렉토리에 Vector Asset 5개를 추가한다. res/menu 폴더를 만들고 bottom_menu.xml 파일을 만든다. <menu xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:id=”@+id/action_airplane” android:enabled=”true” android:icon=”@drawable/ic_baseline_flight_24″ android:title=”비행기”/> <item android:id=”@+id/action_airport” android:enabled=”true” android:icon=”@drawable/ic_baseline_filter_drama_24″ android:title=”버스”/> <item android:id=”@+id/action_bt” android:enabled=”true” android:icon=”@drawable/ic_baseline_emoji_events_24″ android:title=”블루투스”/> <item android:id=”@+id/action_call” android:enabled=”true” android:icon=”@drawable/ic_baseline_drive_eta_24″ android:title=”전화”/> <item android:id=”@+id/action_run” android:enabled=”true” android:icon=”@drawable/ic_baseline_comment_24″ android:title=”사람”/> </menu> frag1.xml 부터 frag5.xml 까지 5개를 만든다. <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”match_parent”> <TextView android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”1번화면 입니다.” android:textSize=”40sp”/> </LinearLayout> activity_main.xml <?xml version=”1.0″ encoding=”utf-8″?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:layout_height=”match_parent” tools:context=”.MainActivity”> <com.google.android.material.bottomnavigation.BottomNavigationView android:id=”@+id/bottomNavi”…
Read More