Book Image

Kivy Cookbook

By : Hugo Solis
Book Image

Kivy Cookbook

By: Hugo Solis

Overview of this book

Table of Contents (16 chapters)
Kivy Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Resizing the screen into iOS


When you run your app in the iOS device, you will note how different it looks from on the screen of your computer. Some widgets could not fit in the screen, and the location of them may change. In this recipe, we will learn how to address this situation using a simple app.

Getting ready

In this recipe, we are going to use the same code which was used in the previous recipe. Also, it is important to read the earlier recipe to know how to run your code in a real iOS device.

How to do it…

Now we have the two files: the main.py file that is the Python file with the operational part of the app and the e1.kv file that is the KV file with the graphical aspects of the app. If we want to improve our app design, we can run it like this:

$ python main.py -m screen:ipad3

If we want to see it as on an iPhone, we use this:

$ python main.py -m screen:iphone5,portrait

How it works…

We used the module screen that permits us to simulate the screen of the most common iOS devices. If...