2016-04-15 31 views
0

私は、ScreenManagerの画面の1つを横向きにするアプリケーションを開発しています。私はそれがそれ自身で垂直に変わることを望んでいません。現時点では、私が学んだのはbuildozer.specファイルだけでアプリの向きを変えることができるということです。私が望むのは、ウィジェットの向きを変えることです。これを行う方法はありますか?Kivyウィジェットの向きを横向き/縦向きにする

+0

あなたのbuildozerファイルで、 'orientation = all'を使って、https://gist.github.com/rnixx/c60a744576866a7f1a42でこれを試してみてください。 – SotirisTsartsaris

答えて

1

あなたは散布レイアウト上の画面のコンテンツを配置し、それを回転させることができます。

test.kv:

ScreenManager: 

    Screen: 
     name: 'normal' 

     Grid 

    Screen: 
     name: 'flipped' 

     ScatterLayout: 
      do_rotation: False 
      do_scale: False 
      do_translation: False 
      rotation: 90 
      pos_hint: {'center_x': 0.5, 'center_y': 0.5} 
      size_hint: None, None 
      size: root.height, root.width 

      Grid 


<[email protected]>: 
    cols: 1 

    Button: 
     text: 'normal' 
     on_press: app.root.current = 'normal' 
    Button: 
     text: 'flipped' 
     on_press: app.root.current = 'flipped' 

main.py:

#!/usr/bin/env python2 
# -*- coding: utf-8 -*- 
from kivy.app import App 


class Test(App): 
    pass 


Test().run() 

@edit また、プライヤーのOrientationもあります。

関連する問題