title: Unable to start activity ComponentInfo: Binary XML file line #10 Error
body: <p>I wanna develop <strong>NavigationDrawer</strong> with Android-Studio.<br/>
  So, When I add <strong>NavigationView</strong>(activity_main.xml), it gets on Error.
  <br/>
  When I add only Toolbar &amp; NavigationView Code in xml, it has no problem,<br/>
  but, look at the <strong>activity_main.xml</strong>. It has ViewPager, DotsIndicator, BottomNavigationView..<br/></p>
  <p><a href="https://i.stack.imgur.com/78Ga0.png" rel="nofollow noreferrer">Hamburger Button on Toolbar</a></p>
  <br/>
  <br/>
  <p><strong>Logcat:</strong></p>
  <pre><code>
      E/AndroidRuntime: FATAL EXCEPTION: main
      Process: com.example.myapplication, PID: 17929
      java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication/com.example.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #10 in com.example.myapplication:layout/activity_main: Binary XML file line #10 in com.example.myapplication:layout/activity_main: Error inflating class com.google.android.material.navigation.NavigationView
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
          at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
          at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
          at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
          at android.os.Handler.dispatchMessage(Handler.java:107)
          at android.os.Looper.loop(Looper.java:214)
          at android.app.ActivityThread.main(ActivityThread.java:7356)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
       Caused by: android.view.InflateException: Binary XML file line #10 in com.example.myapplication:layout/activity_main: Binary XML file line #10 in com.example.myapplication:layout/activity_main: Error inflating class com.google.android.material.navigation.NavigationView
       Caused by: android.view.InflateException: Binary XML file line #10 in com.example.myapplication:layout/activity_main: Error inflating class com.google.android.material.navigation.NavigationView
       Caused by: java.lang.reflect.InvocationTargetException
          at java.lang.reflect.Constructor.newInstance0(Native Method)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
          at android.view.LayoutInflater.createView(LayoutInflater.java:854)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
          at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
          at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696)
          at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170)
          at com.example.myapplication.MainActivity.onCreate(MainActivity.java:50)
          at android.app.Activity.performCreate(Activity.java:7802)
          at android.app.Activity.performCreate(Activity.java:7791)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
          at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
          at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
          at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
          at android.os.Handler.dispatchMessage(Handler.java:107)
          at android.os.Looper.loop(Looper.java:214)
          at android.app.ActivityThread.main(ActivityThread.java:7356)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
  E/AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #27 in com.example.myapplication:layout/nav_header_main: Binary XML file line #27 in com.example.myapplication:layout/nav_header_main: Error inflating class TextView
      Caused by: android.view.InflateException: Binary XML file line #27 in com.example.myapplication:layout/nav_header_main: Error inflating class TextView
      Caused by: java.lang.UnsupportedOperationException: Can't convert value at index 2 to dimension: type=0x1
          at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:786)
          at android.widget.TextView.readTextAppearance(TextView.java:3971)
          at android.widget.TextView.&lt;init&gt;(TextView.java:1064)
          at android.widget.TextView.&lt;init&gt;(TextView.java:968)
          at androidx.appcompat.widget.AppCompatTextView.&lt;init&gt;(AppCompatTextView.java:100)
          at com.google.android.material.textview.MaterialTextView.&lt;init&gt;(MaterialTextView.java:93)
          at com.google.android.material.textview.MaterialTextView.&lt;init&gt;(MaterialTextView.java:88)
          at com.google.android.material.textview.MaterialTextView.&lt;init&gt;(MaterialTextView.java:83)
          at com.google.android.material.theme.MaterialComponentsViewInflater.createTextView(MaterialComponentsViewInflater.java:61)
          at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:115)
          at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1551)
          at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1602)
          at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1061)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:997)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
          at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
          at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
          at com.google.android.material.internal.NavigationMenuPresenter.inflateHeaderView(NavigationMenuPresenter.java:222)
          at com.google.android.material.navigation.NavigationView.inflateHeaderView(NavigationView.java:387)
          at com.google.android.material.navigation.NavigationView.&lt;init&gt;(NavigationView.java:241)
          at com.google.android.material.navigation.NavigationView.&lt;init&gt;(NavigationView.java:122)
          at java.lang.reflect.Constructor.newInstance0(Native Method)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
          at android.view.LayoutInflater.createView(LayoutInflater.java:854)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
          at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
          at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696)
          at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170)
          at com.example.myapplication.MainActivity.onCreate(MainActivity.java:50)
          at android.app.Activity.performCreate(Activity.java:7802)
          at android.app.Activity.performCreate(Activity.java:7791)
          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
          at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
          at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
          at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
          at android.os.Handler.dispatchMessage(Handler.java:107)
          at android.os.Looper.loop(Looper.java:214)
          at android.app.ActivityThread.main(ActivityThread.java:7356)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
  
  </code></pre>
  <br/>
  <br/>
  <p><strong>MainActivity.java:</strong></p>
  <pre><code>
      public class MainActivity extends AppCompatActivity {
      // Toolbar
      private Toolbar toolbar;
      private DrawerLayout drawerLayout;
      private NavigationView navigationView;
  
      // ViewPager &amp; DotsIndicator 
      private ViewPager2 viewPager2;
      private DotsIndicator dotsIndicator;
      private ArrayList&lt;DataPage&gt; list;
  
      // BottomNavigationView
      private BottomNavigationView bottomNav;
      private FragmentManager fragmentManager = getSupportFragmentManager();
      private SearchPage fragmentSearch = new SearchPage();
      private HomePage fragmentHome = new HomePage();
      private CafePage fragmentCafe = new CafePage();
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          // BottomNavigation
          bottomNav = findViewById(R.id.navigationView);
          bottomNav.setOnNavigationItemSelectedListener(new ItemSelectedListener());
  
          this.InitializeLayout(); // Toolbar
  
          this.viewpage(); // viewPager
  
          //FragmentTransaction transaction = fragmentManager.beginTransaction();
          //transaction.replace(R.id.frameLayout, fragmentSearch).commitAllowingStateLoss();
  
      }
  
      // Toolbar
      private void InitializeLayout() {
          //toolBar를 통해 App Bar 생성
          toolbar = findViewById(R.id.toolbar);
          drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
  
          setSupportActionBar(toolbar);
          ActionBar actionBar = getSupportActionBar();
          actionBar.setDisplayShowTitleEnabled(false); 
          actionBar.setDisplayHomeAsUpEnabled(true);  
          actionBar.setHomeAsUpIndicator(R.drawable.ic_reorder_white_24dp);  
  
      
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.menu, menu);
          return true;
      }
  
      
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          //return super.onOptionsItemSelected(item);
          int id = item.getItemId();
          switch (id) {
              case android.R.id.home:
                  drawerLayout.openDrawer(GravityCompat.START);
                  Toast.makeText(getApplicationContext(), &quot;메뉴 버튼 클릭됨&quot;, Toast.LENGTH_LONG).show();
                  return true;
          }
          return super.onOptionsItemSelected(item);
      }
  
      private void viewpage(){
          list = new ArrayList&lt;&gt;();
          list.add(new DataPage(R.drawable.sample_1, &quot;Starbucks&quot;, 4900));
          list.add(new DataPage(R.drawable.sample_2, &quot;Twosome Place&quot;, 4100));
          list.add(new DataPage(R.drawable.sample_3, &quot;EDIYA&quot;, 3000));
          list.add(new DataPage(R.drawable.sample_3, &quot;EDIYA&quot;, 3000));
          list.add(new DataPage(R.drawable.sample_3, &quot;EDIYA&quot;, 3000));
          list.add(new DataPage(R.drawable.sample_3, &quot;EDIYA&quot;, 3000));
          list.add(new DataPage(R.drawable.sample_3, &quot;EDIYA&quot;, 3000));
          list.add(new DataPage(R.drawable.sample_3, &quot;EDIYA&quot;, 3000));
          list.add(new DataPage(R.drawable.sample_3, &quot;EDIYA&quot;, 3000));
          list.add(new DataPage(R.drawable.sample_3, &quot;EDIYA&quot;, 3000));
  
          viewPager2 = findViewById(R.id.viewPager2);
          viewPager2.setAdapter(new ViewPagerAdapter(list));
  
          dotsIndicator = findViewById(R.id.dots_indicator);
          dotsIndicator.setViewPager2(viewPager2);
      }
  
      
      class ItemSelectedListener implements BottomNavigationView.OnNavigationItemSelectedListener {
          @Override
          public boolean onNavigationItemSelected(@NonNull MenuItem menuItem) {
  
              FragmentTransaction transaction = fragmentManager.beginTransaction();
  
              switch (menuItem.getItemId()) {
                  case R.id.searchItem:
                      transaction.replace(R.id.frameLayout, fragmentSearch).commitAllowingStateLoss();
                      break;
                  case R.id.homeItem:
                      transaction.replace(R.id.frameLayout, fragmentHome).commitAllowingStateLoss();
                      break;
                  case R.id.cafeItem:
                      transaction.replace(R.id.frameLayout, fragmentCafe).commitAllowingStateLoss();
                      break;
              }
              return true;
          }
      }
  }
  
  </code></pre>
  <br/>
  <br/>
  <p><strong>activity_main.xml</strong></p>
  <pre><code>
      &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
      &lt;androidx.drawerlayout.widget.DrawerLayout android:id=&quot;@+id/drawer_layout&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:fitsSystemWindows=&quot;false&quot;
      xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;&gt;
  
      &lt;!-- @@@@@ When I add this tag, error @@@@@@--&gt;
      &lt;com.google.android.material.navigation.NavigationView
          android:id=&quot;@+id/nav_view&quot;
          android:layout_width=&quot;200dp&quot;
          android:layout_height=&quot;match_parent&quot;
          android:layout_gravity=&quot;start&quot;
          android:background=&quot;@drawable/side_nav_bar_white&quot;
          android:fitsSystemWindows=&quot;false&quot;
          app:headerLayout=&quot;@layout/nav_header_main&quot;
          app:menu=&quot;@menu/activity_main_drawer&quot;
          app:itemTextAppearance=&quot;@style/text_size&quot;&gt;
      &lt;/com.google.android.material.navigation.NavigationView&gt;
      &lt;!-- @@@@@ When I add this tag, error @@@@@@--&gt;
      &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:orientation=&quot;vertical&quot;
      android:background=&quot;@color/cfb&quot;
      tools:context=&quot;.MainActivity&quot;&gt;
  
      &lt;androidx.appcompat.widget.Toolbar
          android:id=&quot;@+id/toolbar&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;?attr/actionBarSize&quot;
          android:background=&quot;?attr/colorPrimary&quot;
          android:elevation=&quot;4dp&quot;
          android:theme=&quot;@style/ThemeOverlay.AppCompat.Dark&quot;&gt;
  
          &lt;TextView
              android:id=&quot;@+id/toolbar_title&quot;
              android:text=&quot;@string/app_name&quot;
              android:textSize=&quot;25sp&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_gravity=&quot;center&quot;/&gt;
      &lt;/androidx.appcompat.widget.Toolbar&gt;
  
      &lt;FrameLayout
          android:id=&quot;@+id/content_layout&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;0dp&quot;
          android:layout_weight=&quot;1&quot; &gt;
  
          &lt;androidx.constraintlayout.widget.ConstraintLayout
              android:id=&quot;@+id/linearLayout&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;500dp&quot;
              android:layout_marginTop=&quot;100dp&quot;
              android:background=&quot;@color/cfb&quot;
              tools:context=&quot;.MainActivity&quot;&gt;
  
              &lt;TextView
                  android:id=&quot;@+id/TitleText2&quot;
                  android:layout_width=&quot;wrap_content&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:text=&quot;@string/title2&quot;
                  android:textColor=&quot;#000000&quot;
                  android:textSize=&quot;30sp&quot;
                  android:textStyle=&quot;bold&quot;
                  android:layout_marginBottom=&quot;10dp&quot;
                  app:layout_constraintBottom_toTopOf=&quot;@+id/viewPager2&quot;
                  app:layout_constraintEnd_toEndOf=&quot;parent&quot;
                  app:layout_constraintStart_toStartOf=&quot;parent&quot; /&gt;
  
              &lt;ImageButton
                  android:id=&quot;@+id/refreshButton&quot;
                  android:layout_width=&quot;wrap_content&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_marginStart=&quot;30dp&quot;
                  android:layout_marginLeft=&quot;30dp&quot;
                  android:layout_marginBottom=&quot;20dp&quot;
                  android:background=&quot;@color/cfb&quot;
                  app:layout_constraintBottom_toTopOf=&quot;@+id/viewPager2&quot;
                  app:layout_constraintStart_toEndOf=&quot;@+id/TitleText2&quot;
                  app:srcCompat=&quot;@drawable/refresh_111075__2_&quot; /&gt;
  
              &lt;TextView
                  android:id=&quot;@+id/refreshText&quot;
                  android:layout_width=&quot;wrap_content&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:text=&quot;@string/refresh&quot;
                  android:textColor=&quot;#000000&quot;
                  android:textSize=&quot;18sp&quot;
                  android:layout_marginStart=&quot;20dp&quot;
                  android:layout_marginLeft=&quot;20dp&quot;
                  app:layout_constraintStart_toEndOf=&quot;@+id/TitleText2&quot;/&gt;
  
              &lt;ImageButton
                  android:id=&quot;@+id/filterButton&quot;
                  android:layout_width=&quot;wrap_content&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_marginTop=&quot;0dp&quot;
                  android:layout_marginBottom=&quot;10dp&quot;
                  android:layout_marginEnd=&quot;15dp&quot;
                  android:layout_marginRight=&quot;28dp&quot;
                  android:background=&quot;@color/cfb&quot;
                  app:layout_constraintEnd_toEndOf=&quot;parent&quot;
                  app:layout_constraintBottom_toTopOf=&quot;@+id/dots_indicator&quot;
                  app:srcCompat=&quot;@drawable/filter&quot;
                   /&gt;
  
              &lt;TextView
                  android:id=&quot;@+id/filterText&quot;
                  android:layout_width=&quot;wrap_content&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_marginEnd=&quot;25dp&quot;
                  android:layout_marginRight=&quot;40dp&quot;
                  android:text=&quot;@string/filter&quot;
                  android:textColor=&quot;#000000&quot;
                  app:layout_constraintEnd_toEndOf=&quot;parent&quot;
                  app:layout_constraintTop_toBottomOf=&quot;@+id/filterButton&quot; /&gt;
  
              &lt;androidx.viewpager2.widget.ViewPager2
                  android:id=&quot;@+id/viewPager2&quot;
                  android:layout_width=&quot;270dp&quot;
                  android:layout_height=&quot;270dp&quot;
                  android:layout_marginBottom=&quot;130dp&quot;
                  android:orientation=&quot;horizontal&quot;
                  app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
                  app:layout_constraintEnd_toEndOf=&quot;parent&quot;
                  app:layout_constraintHorizontal_bias=&quot;0.5&quot;
                  app:layout_constraintStart_toStartOf=&quot;parent&quot;
                  app:layout_constraintVertical_bias=&quot;0.3&quot; /&gt;
  
              &lt;com.tbuonomo.viewpagerdotsindicator.DotsIndicator
                  android:id=&quot;@+id/dots_indicator&quot;
                  android:layout_width=&quot;wrap_content&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:layout_marginTop=&quot;110dp&quot;
                  app:dotsColor=&quot;@color/white&quot;
                  app:dotsCornerRadius=&quot;8dp&quot;
                  app:dotsSize=&quot;14dp&quot;
                  app:dotsSpacing=&quot;4dp&quot;
                  app:dotsWidthFactor=&quot;2.5&quot;
                  app:layout_constraintEnd_toEndOf=&quot;parent&quot;
                  app:layout_constraintHorizontal_bias=&quot;0.498&quot;
                  app:layout_constraintStart_toStartOf=&quot;parent&quot;
                  app:layout_constraintTop_toBottomOf=&quot;@id/viewPager2&quot;
                  app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
                  app:progressMode=&quot;true&quot;
                  app:selectedDotColor=&quot;@color/black&quot; /&gt;
              &lt;ImageView
                  android:layout_width=&quot;90dp&quot;
                  android:layout_height=&quot;90dp&quot;
                  android:layout_marginStart=&quot;10dp&quot;
                  android:layout_marginLeft=&quot;10dp&quot;
                  android:layout_marginTop=&quot;70dp&quot;
                  android:clickable=&quot;true&quot;
                  app:srcCompat=&quot;@drawable/cafebot&quot; /&gt;
          &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  
          &lt;androidx.constraintlayout.widget.ConstraintLayout
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;match_parent&quot;
              tools:context=&quot;.MainActivity&quot;&gt;
              &lt;FrameLayout
                  android:id=&quot;@+id/frameLayout&quot;
                  android:layout_width=&quot;match_parent&quot;
                  android:layout_height=&quot;0dp&quot;
                  app:layout_constraintBottom_toTopOf=&quot;@id/navigationView&quot;
                  app:layout_constraintLeft_toLeftOf=&quot;parent&quot;
                  app:layout_constraintRight_toRightOf=&quot;parent&quot;
                  app:layout_constraintTop_toTopOf=&quot;parent&quot;/&gt;
  
              &lt;com.google.android.material.bottomnavigation.BottomNavigationView
                  android:id=&quot;@+id/navigationView&quot;
                  android:layout_width=&quot;match_parent&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:background=&quot;?android:attr/windowBackground&quot;
                  app:layout_constraintBottom_toBottomOf=&quot;parent&quot;
                  app:layout_constraintLeft_toLeftOf=&quot;parent&quot;
                  app:layout_constraintRight_toLeftOf=&quot;parent&quot;
                  app:menu=&quot;@menu/bottom_nav&quot; /&gt;
  
          &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  
      &lt;/FrameLayout&gt;
      &lt;/LinearLayout&gt;
      &lt;/androidx.drawerlayout.widget.DrawerLayout&gt;
  
  </code></pre>
  <p><strong>layout/nav_header_main:</strong></p>
  <pre><code>
      &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:background=&quot;#ffffff&quot;
      android:orientation=&quot;vertical&quot;
      android:theme=&quot;@style/ThemeOverlay.AppCompat.Dark&quot;&gt;
  
      &lt;LinearLayout
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;70dp&quot;
          android:background=&quot;@drawable/borderline&quot;
          android:gravity=&quot;left&quot;
          android:orientation=&quot;horizontal&quot;
          android:theme=&quot;@style/ThemeOverlay.AppCompat.Dark&quot;&gt;
  
          &lt;ImageView
              android:id=&quot;@+id/imageView&quot;
              android:layout_width=&quot;80dp&quot;
              android:layout_height=&quot;60dp&quot;
              android:contentDescription=&quot;@string/nav_header_desc&quot;
              android:orientation=&quot;vertical&quot;
              android:paddingTop=&quot;@dimen/nav_header_vertical_spacing&quot;
              app:srcCompat=&quot;@mipmap/cafe_bot&quot; /&gt;
  
          &lt;TextView
              android:layout_width=&quot;100dp&quot;
              android:layout_height=&quot;match_parent&quot;
              android:gravity=&quot;center&quot;
              android:textSize=&quot;@dimen/nav_header_title&quot;
              android:textColor=&quot;@color/black&quot;
              android:text=&quot;@string/nav_header_menu&quot; /&gt;
      &lt;/LinearLayout&gt;
          &lt;LinearLayout
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;60dp&quot;
          android:background=&quot;@drawable/side_nav_bar_white&quot;
          android:gravity=&quot;left|center&quot;
          android:orientation=&quot;vertical&quot;&gt;
              &lt;TextView
                  android:id=&quot;@+id/textView&quot;
                  android:layout_width=&quot;match_parent&quot;
                  android:layout_height=&quot;match_parent&quot;
                  android:gravity=&quot;center&quot;
                  android:textSize=&quot;@dimen/nav_header_subtitle&quot;
                  android:textColor=&quot;@color/black&quot;
                  android:text=&quot;카테고리&quot; /&gt;
      &lt;/LinearLayout&gt;
  &lt;/LinearLayout&gt;
  
  </code></pre>