Android button icon display problem #3137
ndaskalov-mms
started this conversation in
Debugging help
Replies: 1 comment
-
The problem is caused because you're trying to control the size of the button. On Android, Toga uses 48px icons, as that's about the size you can reasonably target with a finger; you're setting the size of the button to 24 pixels, so you're seeing the top quarter of the icon. In general, you should try to avoid setting the width and height of widgets explicitly, as that prevents platforms from adapting to their "natural" size. The only place where setting an explicit size is advisable is when you're setting a width/height of a container that will be much bigger than the widgets it contains, for alignment purposes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm trying to implement button with icon 16x16 only, no text. On Windows it works fine, but on Android the icon is not displayed properly (looks it is cropped and resized) . Below is the simple app to recreate the issue.
import toga
from toga.style import Pack
class ExampleSimpleApp(toga.App):
def main():
return ExampleSimpleApp("Simple App", "org.beeware.toga.examples.simpleapp")
if name == "main":
app = main()
app.main_loop()
Will greatly appreciate if someone can suggest what I'm overlooking.
Regards
Nik
Beta Was this translation helpful? Give feedback.
All reactions