Forum Xamarin.Forms

image button in xaml

how can I create an image button in xaml. all platforms have an image button but I cant create one in xaml. why?


  • michaelwalmsleymichaelwalmsley USMember ✭✭

    or, what I really need is to have a command property on an image, at the least an click event?

  • rmarinhormarinho PTMember, Insider, Beta Xamurai
  • michaelwalmsleymichaelwalmsley USMember ✭✭

    thanks a lot.

    why is there no pointer to this on the main xamarin documentation pages. it should be.

    Ive asked on the forums, ive asked the success team for any info like this. but nothing.

    Why does it take so long to get to the fact that this exists?

  • rmarinhormarinho PTMember, Insider, Beta Xamurai

    @michaelwalmsley‌ this is a open source project by the community , it's not official by Xamarin, it jus a toolkit of controls of services the Xamarin community is sharing and maintaining.
    Feel free to jump at:

  • EmilyChristyEmilyChristy GBMember ✭✭

    An old thread but worth leaving an answer here.

    <Button BackgroundColor="Green" TextColor="White" Text="Scan" Command="{Binding DoNextCommand}" AbsoluteLayout.LayoutBounds=".5,350,160,60" AbsoluteLayout.LayoutFlags="XProportional" BorderRadius="30">
                <OnPlatform x:TypeArguments="FileImageSource"
                        iOS="[email protected]"
                        Android="btn_next.png" />
  • XigmondXigmond USMember ✭✭✭
    edited January 2019

    I created a custom control called XImgBtn

    An Image View with Tap Gesture Recognizer (Different image sources for Up and Pressed Conditions) and Tap/Click Animation for Xamarin Forms

    you can also pass the desired variables to the click handler using "XibId" (to pass an Int) & "StrParam" (to pass a string) when you have multiple XimgBtns.

    Nuget: undefined

    Source: undefined

Sign In or Register to comment.