Questions tagged [kivy-language]

A language created and used in the Kivy framework to describe a widget structure of a project.

Kivy language (kv, kvlang) is a language created and used in the Kivy framework to describe a widget structure of a project.

The concept behind kv is to make maintaining mainly the design part of an application simple. Kv provides features that make building an application easy and readable in large projects:

With these features kv allows very fast prototyping and agile changes to User Interface. It also facilitates a good separation between the logic of an application and its UI, therefore provides possibilities to minimize code size and maximize readability.

For real-time debugging of the kv code you can use KivyCatalog.

2724 questions
6
votes
1 answer

No module named 'kivy.graphics.instructions' while trying to use kivy master

My app works well while using kivy==2.0.0 and kivymd, but it doesn't display numeric keyboard in android devices. So as I investigated,I've got to use master branch of kivy to solve this issue.Now when I run the app with master branch I receive this…
6
votes
0 answers

How to make a Kivy app maintain consistent size, when dragging between two screens of different pixel density?

I am experimenting with the sample code in the kivy_examples package. On a Macbook Pro with a Retina display, that is also connected to an external monitor with standard pixel density. When I launch any of the example apps, the window first appears…
Steve Perkins
  • 11,520
  • 19
  • 63
  • 95
6
votes
3 answers

Kivy sounds do not play on android device even though they play fine on laptop

I am trying to play a sound using Kivy. The sound plays perfectly and everything works perfectly on my laptop, but when I load the APK on my Android device, the sound does not play. I have manually allowed "storage permissions" on my android device,…
6
votes
1 answer

Kivy ScrollView of Label won't scroll

I have a Label inside a ScrollView, hoping that that when the (multiline) text takes up too many lines, the user can scroll up & down, and when the lines are too long, the user can scroll left & right. And I can't get it to scroll. Here's the…
sh37211
  • 1,411
  • 1
  • 17
  • 39
6
votes
1 answer

Include .kv/.json files while packaing kivy with PyInstaller --onefile?

I've got a very simple App (just a window with a label) and I am trying to walk myself through the process of turning into a single executable. Here is the program directory: brainfreeze/ main.py # simple app main.kv # kv language style sheet …
pstatix
  • 3,611
  • 4
  • 18
  • 40
6
votes
1 answer

How can I use an animated gif that will play when pressed as a button in kivy?

I have this toggle button in kivy and I want it to animate on when pressed (it's a power on button gif) but without looping. I can't seem to find any useful information about this. Any help is appreciated, thanks!
Baxorr
  • 298
  • 6
  • 20
6
votes
1 answer

How to use pos_hint with FloatLayout in kivy?

I am trying to align labels and button in my test UI this is my kv file : Label: text: "foo" color: 0,1,0,1 #pos:120,20 pos_hint:{"right":0.1,"top":1} Label: text:"boo" color:…
Eka
  • 14,170
  • 38
  • 128
  • 212
6
votes
1 answer

Config Kivy > Invert input for y axis

I am trying to setup a "off-brand" touchscreen on a Raspberry Pi3 and I am having some trouble when I run my python/kivy program, visually everything is fine, but whenever I need to move a slider, push a button or whatever. the input y-axis is…
6
votes
2 answers

Python / Kivy: conditional design in .kv file

Would an approach similar to the example below be possible in Kivy? The code posted obviously doesn't work, and again it's only an example: I will need different layouts to be drawn depending on a certain property. How would you suggest working…
nxet
  • 738
  • 2
  • 10
  • 22
6
votes
3 answers

Kivy TextInput horizontal and vertical align (centering text)

How to center a text horizontally in a TextInput in Kivy? I have the following screen: But I want to centralize my text like this: And this is part of my kv language: BoxLayout: orientation: 'vertical' Label: …
Carlos Porta
  • 1,224
  • 5
  • 19
  • 31
6
votes
1 answer

Linking a Kivy Button to Function

There is something in kivy I do not understand, and am hoping that someone could shed light. I have done a lot of reading in this topic but it just doesn't seem to be connecting in my head. My issue comes from linking a function to a kivy…
Jake
  • 303
  • 5
  • 19
6
votes
0 answers

Correct way to implement 2d tiled map on Kivy

I'm learning to use Kivy and for this I'm trying to create a 2d game. So, I'm using Map Editor to generate a tmx file and load it on Kivy using this tutorial. However, this tutorial is for a static maps. I need a code, where my main character will…
Carlos Porta
  • 1,224
  • 5
  • 19
  • 31
6
votes
3 answers

Changing color of a part of text of a Kivy widget

I am trying to write a program where if I press a button, the color of a part of the text of a Label widget changes. For example, there's a Label widget with text "1/0". Now, if I press the button, the color of 1 changes to some assigned color. This…
Parthib Biswas
  • 471
  • 1
  • 7
  • 17
5
votes
2 answers

kivy : TypeError: 'NoneType' object is not subscriptable in python

When I run this code, it reveals that "TypeError: 'NoneType' object is not subscriptable". I Want to switch to others screen when I Click to buttons I'm making a small program and I ran into the error "TypeError: 'NoneType' object is not…
siitaw
  • 107
  • 3
  • 12
5
votes
1 answer

Kivy: MDIconButton not centering in Gridlayout and MDLabel with button behavior cannot be moved

I'm new to Kivy and I want to make a signin screen for my app. I have two problems. First, inside my Gridlayout I have 3 MDIconbuttons and they cannot seem to be centered no matter what I try. Second, I want the MDLabel with the text "Forgot your…
cg-algo
  • 79
  • 5