Nemo
Nemo

Reputation: 50

kivy button image display issue

I have a refresh button with a custom image. Everything looked fine, but once I upgraded to Windows 10 (I was on 8) I get this weird display issue where the image doesn't stretch to completely cover the button surface. Instead, a tiny version of the image is shown in the middle of the button.Image shows a textbox with an oversized button for clarity.

Also, here is my Kv code:

Button:
    id: generate_btn
    size_hint_x: 0.5
    size_hint_y: 0.5
    background_normal: 'refresh.jpg'

Upvotes: 0

Views: 850

Answers (1)

Yoav Glazner
Yoav Glazner

Reputation: 8066

Try using a nested Image and allow_stretch

Button:
    id: generate_btn
    size_hint_x: 0.5
    size_hint_y: 0.5
    Image:
        allow_stretch: True
        size: generate_btn.size
        source: 'refresh.jpg'
        pos: generate_btn.pos

My guess is that you have problems because you have changed screen resolution when you moved to windows 10

Upvotes: 2

Related Questions