Hej
I want to create my own radio button in kivy. For that I am using a template:
<myCheckBox@ToggleButton>:
background_normal: 'gfx/cbActive.png'
background_down: 'gfx/cbInactive.png'
background_disabled_down: 'gfx/cbActive.png'
background_disabled_normal: 'gfx/cbInactive.png'
The button looks like:
When using the template at the App it can be downscaled but the downscale process does not scale it symmetrically. It looks like:
Any ideas on why the downscaling isn't symmetrical?
The style for Button
(and ToggleButton
) uses a BorderImage
to scale the background. This allows the standard button-type images to be used appropriately. But you can easily disable this behavior by setting the border property used for scaling:
<myCheckBox@ToggleButton>:
border: 0, 0, 0, 0
background_normal: 'gfx/cbActive.png'
background_down: 'gfx/cbInactive.png'
background_disabled_down: 'gfx/cbActive.png'
background_disabled_normal: 'gfx/cbInactive.png'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.