Learn to Make Beautiful Mobile Apps in Python | KivyMD Tutorial - NavigationDrawer and MD Icons

Поделиться
HTML-код
  • Опубликовано: 14 янв 2025

Комментарии • 109

  • @sanket.chaudhary
    @sanket.chaudhary 4 года назад +9

    I still not got it that what to do with the error :
    Unable to import package 'kivymd.navigationdrawer.NavigationLayout'
    What do i do with that plss tell me!!!!

    • @bikuburagohain4902
      @bikuburagohain4902 4 года назад +2

      i facing the same problem here

    • @bikuburagohain4902
      @bikuburagohain4902 4 года назад +2

      Please help if anyone knows how to handle this error

    • @robertgodek1245
      @robertgodek1245 4 года назад +2

      @@bikuburagohain4902 #:import NavigationLayout kivymd.uix.navigationdrawer

    • @neilfernando1384
      @neilfernando1384 4 года назад +1

      If you are using the updated version of KivyMD (which I think you are), you don't need to:
      #: import 'kivymd.navigationdrawer.NavigationLayout into your main.kv file.
      If the problem persists, you need to look for the specific folder where the NavigationLayout class has been stored and use that path file instead..

    • @sonoda7723
      @sonoda7723 4 года назад

      you don't need to import them, just write the .kv directly without

  • @erik-sandberg
    @erik-sandberg  5 лет назад +12

    NOTE: Newer version of KivyMD don't require that you import the modules, so you can avoid the "#:import" lines in the .kv file (widgets have moved from the kivymd folder to the kivymd.uix folder, so you will get an error if you try to import them from the kivymd folder as I show in the video). Also, In case you don't make it all the way to the end, you can open the menu by calling the open_nav_drawer() function of your NavigationLayout (note that is not the NavigationDrawer!). Also, I'm planning on covering MDToolbars in the next video. What KivyMD widgets do you want me to do after that?

    • @KivyMD
      @KivyMD 5 лет назад

      Why do you give a link to the old library with icons?

    • @erik-sandberg
      @erik-sandberg  5 лет назад

      @@KivyMD That's where I found the icons after searching by myself, do you have a better updated one? I will update the link if so!

    • @KivyMD
      @KivyMD 5 лет назад

      @@erik-sandberg 3695 icons!

    • @erik-sandberg
      @erik-sandberg  5 лет назад

      @@KivyMD Thank you!! I updated the link in the description and will use this link from now on.

    • @rogersmacharia4222
      @rogersmacharia4222 5 лет назад +1

      Useful, I removed the #:import part and the error "unable to import package kivymd.toolbar.MDToolbar" has gone. Thanks

  • @JoelGGuitarist
    @JoelGGuitarist 5 лет назад +1

    Thank you so much for making this! I always used regular kivy but had trouble getting MD to work for me!

  • @Александр-р3э3м
    @Александр-р3э3м 4 года назад +1

    Hello, i have a problem with importing packages (3:35). It returns me an error: Unable to import package 'kivymd.navigationdrawer.NavigationLayout'
    when i try to import. Help please

    • @erik-sandberg
      @erik-sandberg  4 года назад

      Check the pinned comment

    • @Александр-р3э3м
      @Александр-р3э3м 4 года назад

      @@erik-sandberg Yes thanks, i saw your pinned comment later. Now i dont import any packeges, but i get another error, when i try to swipe in app to drag the NavigationDrawer: AttributeError: 'NoneType' object has no attribute 'rgba'
      Help please
      Here is the code from py file:
      from kivy.app import App
      from kivymd.app import MDApp
      from kivymd.theming import ThemeManager
      class MainApp(MDApp):
      def build(self):
      self.theme_cls = ThemeManager()
      self.theme_cls.primary_palette = "Blue"
      self.theme_cls.theme_style = "Dark"
      MainApp().run()
      And the code from kv file:
      NavigationLayout:
      MDNavigationDrawer:
      drawer_logo: "landscape.jpeg"
      md_bg_color: app.theme_cls.primary_light
      Note:
      I have changed inheritance of app class to MDApp, because it returned me an error:
      ValueError: KivyMD: App object must be inherited from `kivymd.app.MDApp`
      Thanks

    • @Александр-р3э3м
      @Александр-р3э3м 4 года назад +1

      Guys! Who has the same problem, just put the ScreenManager, like this:
      NavigationLayout:
      ScreenManager:
      MDNavigationDrawer:

    • @ivana1755
      @ivana1755 4 года назад +1

      @@Александр-р3э3м I've got this: kivy.uix.screenmanager.ScreenManagerException: ScreenManager accepts only Screen widget.
      Has anyone figured it this out?

    • @Александр-р3э3м
      @Александр-р3э3м 4 года назад

      @@ivana1755 Could you show me your .kv file?

  • @awadhimassomo1145
    @awadhimassomo1145 4 года назад +10

    is there any update cause i keep getting errors

  • @raghimnajafov9203
    @raghimnajafov9203 4 года назад +1

    You're great.I expect more training on KivyMd👏

  • @ScoutKnows
    @ScoutKnows 5 лет назад +2

    Hi I have a problem with this one:
    #: import NavigationLayout kivymd.navigationdrawer.NavigationLayout
    #: import MDSeperator kivymd.card.MDSeperator
    NavigationLayout:
    MDNavigationDrawer:
    # drawer_logo: "mercedes.jpg"
    Button:
    text: "i'm happy, what about you !"
    the error is : Unable to import package 'kivymd.navigationdrawer.NavigationLayout'
    any idea on what's going on here ?
    Thanks

    • @erik-sandberg
      @erik-sandberg  5 лет назад +2

      You probably have the newest version of KivyMD which changed how you import things. You actually don't need to use the import statements at all, so you can remove them from your code!

    • @ScoutKnows
      @ScoutKnows 5 лет назад +2

      @@erik-sandberg yes it works now, thank you

    • @nickdrost7401
      @nickdrost7401 5 лет назад

      #:import NavigationLayout kivymd.uix.navigationdrawer.NavigationLayout

  • @wisyall
    @wisyall 4 года назад +1

    HI, can you make a video on how to design and put stuff in those screens. currently new to kivy and do not know much.

  • @victorbrorson1201
    @victorbrorson1201 4 года назад +2

    Hey Erik! Great videos. I keep getting 2 Errors. First one says: "No module named kivymd.themin", however, when i remove the theme the app runs, but now i get the error saying: "Only on root object is allowed by .kv". Can you help me out ? :))

  • @hanybarca
    @hanybarca 5 лет назад +1

    did they remove the NavigationDrawerIconButton ? because i cant find it anywhere , in their new example they are using a custom called NavigationItem but the icon of the button can't be pressed only the button is .

    • @Felix-vu9tz
      @Felix-vu9tz 4 года назад

      the devs changed the widget in an update, you're better off following this doc kivymd.readthedocs.io/en/latest/components/navigation-drawer/index.html

  • @tazimrahbar7882
    @tazimrahbar7882 4 года назад

    Which version you are using sir

  • @mehediabdullah9852
    @mehediabdullah9852 5 лет назад +1

    Good work, carry on and make more projects please..

  • @atuljain5943
    @atuljain5943 4 года назад

    You can also get the list of all icons in the Kitchen Sink demo under the MD Icons section

  • @vahidahmadi6703
    @vahidahmadi6703 4 года назад

    Hi, is it possible to save the chosen theme for next runs?

  • @falcaoestrano5136
    @falcaoestrano5136 5 лет назад +1

    Thank you !! How do I use the NavigationDrawer as a ScreenManager ?

    • @erik-sandberg
      @erik-sandberg  5 лет назад

      To use the navigation drawer to change screens, swap out where I put the Button with a ScreenManager. Then change the on_release function of the NavigationDrawer buttons to refer to your ScreenManager! :)

    • @arsalanahmad1832
      @arsalanahmad1832 5 лет назад

      @@erik-sandberg dude can you please give an example of the same thing and post the code here because I tried a lot but could not work

    • @amitziv171
      @amitziv171 5 лет назад +1

      @@erik-sandberg great tutorial, but is there any way to use the ScreenManager without removing the whole NavigationDrawer? I mean, if you switch a screen, you won't have that single-page-application (with NavDrawer) effect.

  • @cirogoyeneche9400
    @cirogoyeneche9400 5 лет назад +1

    Hi, Erik!. Thanks for making these videos, we all really appreciate it.
    I have a question, can I change the icon's default size? How can I do it?
    Thanks.

  • @Jason-de3oo
    @Jason-de3oo 4 года назад +1

    I am having errors importing NavigationLayout.
    Please I need help.

  • @serious6037
    @serious6037 3 года назад

    i cant install theming lol. and its not included in kivymd. wtf should i do?

  • @Kaemer1000
    @Kaemer1000 4 года назад +1

    Guys! This is deprecated version of nav drawer, if you don't want a problem check buildwithpython tutorial. That's not an AD :|

  • @danielspring1574
    @danielspring1574 4 года назад

    nice explanation

  • @rogersmacharia4222
    @rogersmacharia4222 5 лет назад

    Very helpful. Thanks

  • @samarayan35
    @samarayan35 4 года назад

    Sir , what if i want to put my own icon in mya navigation button, is that possible?If possible, how can i do it sir?

  • @srinivassagit2573
    @srinivassagit2573 5 лет назад +1

    Good bro! How to add both image and text like android navigation bar??

    • @devenderkamboj6588
      @devenderkamboj6588 5 лет назад +1

      Bhai tu kivy kabsa sika Raha ha bhai kya tu apna WhatsApp number da sakta ha kivy ma help ka lya please bro really I need help

    • @srinivassagit2573
      @srinivassagit2573 5 лет назад

      @@devenderkamboj6588 join in kivy discord app bro!

  • @pablodiaz1811
    @pablodiaz1811 5 лет назад

    Thanks for share. Useful

  • @corollagl82
    @corollagl82 2 года назад

    Please help can't execute Navigation Drawer, always having error with uix_path : ImportError: cannot import name 'uix_path' from 'kivymd' (D:\ProgramData\Anaconda3\envs\inventory\lib\site-packages\kivymd\__init__.py)

  • @gotta_dive_into_python
    @gotta_dive_into_python 5 лет назад

    That was really helpful, thanks!

  • @gaotrunguyen
    @gaotrunguyen 3 года назад

    Sir, please help me:
    I would like to have my LoginScreen(or welcome screen, users just click”start” to go to my main home screen) as a default screen for when application starts. After a users click button start, this should lead them to the Home screen, which is a part of my MDBottomNavigation (and the Login Screen is not!). I'm trying to make the Login screen independent from the MDBottomNavigation... and I can't. Right now at the start I see both the Login screen and the Home screen with the MDBottomNavigation.
    Please give me a hint.

  • @notcloyd1674
    @notcloyd1674 4 года назад

    What language is he using in that main.kv file? Sorry newb here

    • @erik-sandberg
      @erik-sandberg  4 года назад +1

      It's the kv language -- it's the "language" that Kivy uses to build user interfaces. A common mistake for kivy beginners is to think "I'll just do it all in Python". While possible, it makes things a lot tougher, so do yourself a favor and practice kv-lang a bit!

    • @notcloyd1674
      @notcloyd1674 4 года назад

      @@erik-sandberg thank you man!

  • @CodeStudio7750
    @CodeStudio7750 3 года назад +1

    Very very helpful super tutorial 😍😍😍😍😍😍😍😍😍😍!!!

  • @noahleu1507
    @noahleu1507 5 лет назад

    Hey Erik!
    Thank you for making these videos covering kivy and kivyMD.
    Since I am working on a project which requires a login,
    Is there any way in which I can show a NavigationLayout on every screen except the one with the login?

    • @erik-sandberg
      @erik-sandberg  5 лет назад +1

      Definitely! You just need to think about the widget architecture a little bit. Probably your root widget will be a screenmanager with two screens - the first is your login, the second is your main app. the main app screen would then have the NavigationLayout widget.

    • @noahleu1507
      @noahleu1507 5 лет назад +1

      @@erik-sandberg thank you for responding so quickly ^^
      I am going to try this and thinking about this it does make a lot of scence this way
      I'm new to kivy and found it because of your awesome channel
      Thanks again

    • @erik-sandberg
      @erik-sandberg  5 лет назад

      @@noahleu1507 That's great! Good luck and keep practicing, it takes some time but it's really intuitive after a bit! :)

    • @noahleu1507
      @noahleu1507 5 лет назад

      @@erik-sandberg yes it does but I am making progress for sure ^^

    • @wisyall
      @wisyall 4 года назад

      @@noahleu1507 Hey! Would you be able to help me with this? I am doing something similar right now!

  • @rafimochamadfahreza75
    @rafimochamadfahreza75 5 лет назад

    Hi erik! i got some problem,the problem is i have the button inside scrollview but the button can give me on_release or on_press event and not clickable, how to fix this?

  • @kalyanasundaram9021
    @kalyanasundaram9021 5 лет назад

    i have got a problem. while running it says unable to import 'NavigationLayout Kivymd.navigationdrawer.NavigationLayout'

    • @erik-sandberg
      @erik-sandberg  5 лет назад +1

      Check the pinned comment

    • @sanket.chaudhary
      @sanket.chaudhary 4 года назад

      Did you get it that how to solve this problem??
      I did not get it plss tell me

  • @johnwall5526
    @johnwall5526 5 лет назад

    I've got a problem where my navigation drawer freezes when an async image is displayed, it covers over the side drawer. How should I fix it?

  • @sinistergeek
    @sinistergeek 5 лет назад

    Wow bruh!! Meaning to start building app for my youtube channel...You gave hope lol.....Imma try making one app when it's done imma let you know!! Thanks

    • @erik-sandberg
      @erik-sandberg  5 лет назад

      Go for it man!

    • @sinistergeek
      @sinistergeek 5 лет назад

      @@erik-sandberg Well could help me!! I have multiple python file as well as kivy file how am i supposed to make apk file!!

    • @chunchunmaru3644
      @chunchunmaru3644 4 года назад

      @@sinistergeek By using python for android
      Buildozer automates the operation
      Best of luck !

  • @hermsstanley
    @hermsstanley 4 года назад

    Getting an import error when I try to rub kitchen sink.. main.py
    -importerror: cannot import name 'MDExpansionPanelOneLine' from Kivymd.uix.expansionpanel

    • @hermsstanley
      @hermsstanley 4 года назад

      I am using Anaconda.. I have install the kivymd

    • @hermsstanley
      @hermsstanley 4 года назад

      I am using Windows

  • @anhadsingh4336
    @anhadsingh4336 5 лет назад +1

    Please make the kivy friendly fitness with kivymd please. Humble request

    • @erik-sandberg
      @erik-sandberg  5 лет назад

      Good suggestion! I like the idea - when I have time I will work on it. It would be a substantial amount of work to record and I'm going to be very busy for a bit, but I'll definitely try to get it done!

    • @anhadsingh4336
      @anhadsingh4336 5 лет назад

      @@erik-sandberg thanks. You are the best teacher I have ever met

  • @jonathanameyo3608
    @jonathanameyo3608 4 года назад

    how can I open a a jpg image in pycharm?

  • @Maxcybercom
    @Maxcybercom 4 года назад

    Hi everyone.
    I'm getting kind of problem and got white screen only after coding first codes
    [WARNING] [MTD ] Unable to open device "/dev/input/event6". Please ensure you have the appropriate permissions.

  • @pysuhayb15
    @pysuhayb15 5 лет назад

    thanks please more

  • @tazimrahbar7882
    @tazimrahbar7882 4 года назад

    Drawer login not working

  • @prestonwallitsch8636
    @prestonwallitsch8636 4 года назад

    Kept on getting this error: ValueError: KivyMD: App object must be inherited from `kivymd.app.MDApp`. See github.com/kivymd/KivyMD/blob/master/README.md#api-breaking-changes

  • @imtiazahmad7826
    @imtiazahmad7826 5 лет назад

    can you make game with kivy

  • @oscarys
    @oscarys 4 года назад +3

    This whole interface has changed quite a lot for version 0.104.1 of KivyMD, rendering this otherwise excellent tutorial obsolete.

  • @bcburnettcom
    @bcburnettcom 3 года назад +1

    Everything is broken in this tutorial!

  • @tazimrahbar7882
    @tazimrahbar7882 4 года назад

    New version of kivy md is very bad

  • @баобаб-ю4о
    @баобаб-ю4о Год назад

    Hi, I can't fix that Unable to import package HELP