Trouble with ImageButton

19 views
Skip to first unread message

Nem1n

unread,
Feb 21, 2019, 5:56:16 AM2/21/19
to Kivy users support
Hello guys,

It seems that I have some trouble with the size of my ImageButton when I build Myapp.apk. In Android my ImageButtons are really small.
Hope somebody can help me.

This firt method crash my app:

Button:
background_color: (0,0,0,0)
id: button
on_press:
root.manager.transition.direction = "left"
root.manager.current = 'experience'
Image:
source:'data/work.png'
size: button.size
pos: button.pos

This one work but the picture is too small
ImageButton:
source:'data/education.png'
on_press:
root.manager.transition.direction = "left"
root.manager.current = 'education'

ZenCODE

unread,
Feb 22, 2019, 5:39:36 AM2/22/19
to Kivy users support
Try and get the log so you can see why the first one crashes. It's probably to do with what happens in the 'on_press', as the rest looks fine. That should sort your sizing  problem, but you may want to set "allow_stretch" to True. Or maybe not..:-)

Nemine Ali

unread,
Feb 28, 2019, 2:26:23 AM2/28/19
to kivy-...@googlegroups.com
Hi, 
Thanks for the answer,

I' have no idea how to get the log, can you tell me please?

For the image button I change the size of the source for a bigger and it went bigger to the apk.

I have another question it's been few days I try to have a button who can scroll the view to the bottom or the middle of the page, how can I do that if it's possible?




Le ven. 22 févr. 2019 à 11:39, ZenCODE <zenkey....@gmail.com> a écrit :
Try and get the log so you can see why the first one crashes. It's probably to do with what happens in the 'on_press', as the rest looks fine. That should sort your sizing  problem, but you may want to set "allow_stretch" to True. Or maybe not..:-)

--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To post to this group, send email to kivy-...@googlegroups.com.
Visit this group at https://groups.google.com/group/kivy-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/58686e79-5299-495a-a7dc-87985f86d8f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ZenCODE

unread,
Feb 28, 2019, 4:40:53 AM2/28/19
to Kivy users support
Reply all
Reply to author
Forward
0 new messages