Home > Mobile >  The first line of code in the third edition 12.3 routine is not operating properly
The first line of code in the third edition 12.3 routine is not operating properly

Time:03-10

12.3 is sliding menu, according to the code of the book, the app running is sliding menu covers the toolbar controls, unable to retract and pull out,

Gitee address

CodePudding user response:

 
<? The XML version="1.0" encoding="utf-8"?>
XMLNS: app="http://schemas.android.com/apk/res-auto"
The android: id="@ + id/drawerLayout"
Android: layout_width="match_parent"
Android: layout_height="match_parent" & gt;

<frameLayout
Android: layout_width="match_parent"
Android: layout_height="match_parent" & gt;

The android: id="@ + id/toolbar"
Android: layout_width="match_parent"
Android: layout_height="? Attr/actionBarSize
"Android: background="? Attr/colorPrimary
"Android: theme="@ style/ThemeOverlay. AppCompat. Dark. ActionBar"
App: popupTheme="@ style/ThemeOverlay. AppCompat. Light"/& gt;


Android: layout_width="match_parent"
Android: layout_height="match_parent"
Android: background="# FFF
"Android: gravity="start"
Android: text="This is the menu"
Android: textSize="30 sp/& gt;"



You covered the TextView put FrameLayout ah, you try the TextView deleted

CodePudding user response:

@ can't write code monkey
It is in the book, the author to write wrong?

CodePudding user response:

reference 1st floor can't write code monkey reply:
 
<? The XML version="1.0" encoding="utf-8"?>
XMLNS: app="http://schemas.android.com/apk/res-auto"
The android: id="@ + id/drawerLayout"
Android: layout_width="match_parent"
Android: layout_height="match_parent" & gt;

<frameLayout
Android: layout_width="match_parent"
Android: layout_height="match_parent" & gt;

The android: id="@ + id/toolbar"
Android: layout_width="match_parent"
Android: layout_height="? Attr/actionBarSize
"Android: background="? Attr/colorPrimary
"Android: theme="@ style/ThemeOverlay. AppCompat. Dark. ActionBar"
App: popupTheme="@ style/ThemeOverlay. AppCompat. Light"/& gt;


Android: layout_width="match_parent"
Android: layout_height="match_parent"
Android: background="# FFF
"Android: gravity="start"
Android: text="This is the menu"
Android: textSize="30 sp/& gt;"



You covered the TextView put FrameLayout ah, you try the TextView deleted

No, still no scroll menu,

CodePudding user response:

CodePudding user response:

CodePudding user response:

This code is executed as a result, don't know if you want

CodePudding user response:

refer to 6th floor can't write code monkey reply:
these are the result of the code execution, don't know if you want

I did not want the results, the effect of drawerlayout pull from the side of the menu,
  • Related