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

How to create an ImageButton that scale the GridCell for iOS, Android and Win Phone?

$
0
0

Hi
I have tried the XLabs ImageButton control and it works fine, but it only works if you know the size of the image/button. I have written a ImageButton control for Windows Phone (using Custom Renderer), and here it is very easy to let the button resize it self so it fits its content (different size of images).

For iOS and Android i can not figure out how to do the same? I can't find any properties the resize the button size so it´s fits the buttons content (i have to set a height and width. I have tried all possible layouts in the Xamarin Forms, but they have any impact on the scale of the button and the content.

What i want is to fill a 3 x 4 matrix grid with a custom image button so it fills the gird cell and have all the button properties (feedback etc.) The image must scale to fit the size of the button and the button must scale to fill the GridCell (so it work on all form factors for my many types of devices).

Hope any one here can help me with this, thanks :-)

(Beside: I know i can just make a tap-gesture on an image in Xamarin Forms, but i will not have the feedback and the button animations from each OS, so this is no go!)


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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