简体   繁体   中英

How to get back to default screen size in kivy?

Unfortunately I used the following:

Config.set('graphics','width',850)
Config.set('graphics','height',850)
Config.write()

in my of kivy file. My kivy application's window(screen) is opening in 'ipad' screen size(denoted in Screen module). From that instance in 'config.ini' system added '[module] screen = ipad'. Help me get through this and how to restore my screen size to normal?

  1. The default settings for height and width is as follow. Edit the config file located in ~/.kivy/config.ini .

     [graphics] height = 600 width = 800
  2. In your kivy app, either remove / comment off the write statement, or write the new config into your app directory.

The default values for height and width is (600, 800)

To rest you can either do

  1. Rerun Configer.set with default values.
 Config.set('graphics','width',800)
 Config.set('graphics','height',600)
 Config.write()
  1. Or manual edit the config file
[graphics]
height = 600
width = 800
  1. Or you can just remove the config.ini . On the next run it will automatically be created with default values

The config file will be here:
  • Windows: C:\Users\<UserName>\.kivy\config.ini
  • Linus: /home/<UserName>/.kivy/config.ini
  • macOS: /Users/<UserName>/.kivy/config.ini

Reference: kivy doc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM