Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

ImageButton - why wont it resize to its image content ?

$
0
0

Like most people, I have a need for a 'tappable' image. All mobile development platforms and frameworks have this concept well and truly covered - its fundamental to most apps.

Why do we not have this in Xamarin Forms ? it has always perplexed me - have I missed something ?

I could write a custom renderer to add gesture recognition to an image - but thats a lot of hard work, and I want to try and use what we already have.

I have tried the ImageButton from Forms.Labs - but this really doesn't work correctly. It seems you HAVE to set the width and height of the button for it to work in any meaningful way - but we don't necessarily know the image's width and height at runtime because we may have images of different sizes (and different dip dimensions) for target devices of different sizes and resolutions - so we cannot know the image size exactly except in some very simplistic 'hello world - here is an image button example' type scenarios.

Does anyone have a solution for this ? Has anyone come across these frustrations and found something that works correctly.

Feeling very frustrated

Dean


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>