Home android navigationdrawer

navigationdrawer

Author

Date

Category

You need to add a menu (NavigationDrawer) to the application. As I understood it is done in DrawerLayout, but I already have a constraintlayout in my activat. Tell me how to add please

& lt; 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"
Tools: viewBindingignore = "True" & gt;
& lt; AndroidX.Fragment.app.fragmentContainerView
  Android: id = "@ + id / container"
  Android: layout_width = "Match_Parent"
  Android: layout_height = "280dp"
  App: layout_constraintend_toendof = "parent"
  App: layout_constraintstart_tostartof = "parent"
  App: layout_constrainttop_totopof = "parent" / & gt;
& lt; AndroidX.Fragment.app.fragmentContainerView
  Android: id = "@ + id / container2"
  Android: layout_width = "Match_Parent"
  Android: layout_height = "280dp"
  App: layout_constraintstart_tostartof = "parent"
  App: layout_constraintbottom_tobottomof = "parent"
  App: layout_constraintend_toendof = "parent" / & gt;

& lt; /androidx.constraintlayout.widget.constraintlayout>


Answer 1, Authority 100%

Android Studio has a whole template for a new project: Navigation Drawer Activity.

Create a new project using this template, see how everything is arranged, copy yourself.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions