인프런 커뮤니티 질문&답변

피아노님의 프로필 이미지
피아노

작성한 질문수

하울의 안드로이드 인스타그램 클론 만들기

하울스타그램 메인 네비게이션 탭바 만들기

bottom 네비게이션

작성

·

221

0

왜 이런가요?ㅠㅠ

bottom_navigation_main.xml:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_home"
android:icon="@drawable/ic_home"
android:enabled="true"
android:title="@string/home"/>
<item
android:id="@+id/action_search"
android:icon="@drawable/ic_search"
android:enabled="true"
android:title="@string/home"/>
<item
android:id="@+id/action_add_photo"
android:icon="@drawable/ic_add_a_photo"
android:enabled="true"
android:title="@string/home"/>
<item
android:id="@+id/action_favorite_alarm"
android:icon="@drawable/ic_favorite_border"
android:enabled="true"
android:title="@string/home"/>
<item
android:id="@+id/action_account"
android:icon="@drawable/ic_account"
android:enabled="true"
android:title="@string/home"/>

</menu>


activity_main.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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">

<androidx.appcompat.widget.Toolbar
android:id="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="35dp">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/logo_title" />
</RelativeLayout>

</androidx.appcompat.widget.Toolbar>
<LinearLayout
android:id="@+id/toolbar_division"
android:background="@color/colorDivision"
android:orientation="horizontal"
android:layout_below="@+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="1dp"></LinearLayout>
<FrameLayout
android:id="@+id/main_content"
android:layout_below="@+id/toolbar_division"
android:layout_above="@id/nav_division"
android:layout_width="match_parent"
android:layout_height="match_parent"></FrameLayout>
<LinearLayout
android:id="@+id/nav_division"
android:background="@color/colorDivision"
android:orientation="horizontal"
android:layout_above="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="1dp"></LinearLayout>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_navigation"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:menu="@menu/bottom_navigation_main">
</com.google.android.material.bottomnavigation.BottomNavigationView>

</RelativeLayout>

답변 1

1

저도 똑같이 뜨길래 바텀네이게이션뷰에도 android:background="@color/colorDivision" 를 입력해주었습니다.

피아노님의 프로필 이미지
피아노

작성한 질문수

질문하기