Why doese kivy ignor my config.set and opens on default resolution?

It was okay, but I don't know when, it started ignor my config.set and it's opens on defail resolution. How can i fix it? I'm wonna set a mobile phone resolution.

from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.config import Config
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.textinput import TextInput

Config.set('graphics', 'width', '360')
Config.set('graphics', 'height', '640')

class Container(FloatLayout):
    pass

class MyApp(App):
    def build(self):

        return Container()

    def btn_press(self, instance):
        print(c)

c = 'kek'
if __name__ == "__main__":
    MyApp().run()

and my.kv mb problem in it?

<Container>:
    canvas.before:
        Color:
            rgba: 0.8, 0.8, 0.8, 1
        Rectangle:
            pos: self.pos
            size: self.size

    Button:
        text: 'Расчитать'
        font_size: 16
        on_release: print (c)
        size_hint: (0.8, 0.05)
        pos_hint: {'center_x':.5, 'top':.4}

    Label:
        color: (0,0,0,.6)
        text: 'Первый продукт'
        font_size: sp(18)
        size_hint: (0.8, 0.05)
        pos_hint: {'center_x':.15, 'top':.9}

    TextInput:
        size_hint: (0.2, 0.05)
        pos_hint: {'center_x':.15, 'top':.8}
        text: 'грамм'
        multiline: 0
        foreground_color: 0.58,.58,.58,1

    TextInput:
        size_hint: (0.2, 0.05)
        pos_hint: {'center_x':.15, 'top':.7}
        text: 'рублей'
        multiline: 0
        foreground_color: 0.58,.58,.58,1

And may be you can tell me how to font size for different resolution?



from Recent Questions - Stack Overflow https://ift.tt/3jedqbT
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)