• 카테고리

    질문 & 답변
  • 세부 분야

    모바일 앱 개발

  • 해결 여부

    미해결

bottom 네비게이션

21.04.24 11:55 작성 조회수 167

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

Min Jeong님의 프로필

Min Jeong

2021.04.26

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