locked
AspectFit doesn't work in ImageButton RRS feed

  • Question

  • User385291 posted

    Hi! I've encountered a strange problem. I've got an ImageButton control:

    I want the image in the button to fit inside the button's bounds. That's what Aspect="AspectFit" should do. Unfortunately, the button looks like that:

    What can I do to keep it inside the bounds?

    Monday, May 27, 2019 8:06 PM

All replies

  • User189301 posted

    I think you can use image and use the tap gesture which will serve the purpose of a image button and Aspect will work fine in that case.

    Tuesday, May 28, 2019 7:09 AM
  • User371688 posted

    @gogolon You can try to add the following properties:

    HorizontalOptions="Center" 
    VerticalOptions="Center"
    
    Tuesday, May 28, 2019 12:29 PM
  • User385291 posted

    @jezh - it doesn't work, and I need my buttons to have FillAndExpand by the way. @"anirbandebroy.5119" I want to avoid doing that, to keep button visual effects.

    Wednesday, May 29, 2019 5:57 PM