问题
I am trying to create a button with two images on it. One at left side and one at right side and text in center. After searching I got a button with image only so I wanted to know if it is posible to create a button as I described above in xamarin?
I am trying to create button like this and also I want to change arrow image on the button click to up arrow and down arrow. Is it posible in xamarin to create button like this or should I think about another option any idea?
回答1:
You can't directly do this with the Button from Xamarin Forms as it doesn't support images yet.
From your requirement what you can do is create a horizontal stacklayout and add the images and a label to it. Also set a background color so that it would look like a button. To make it work like a button, add a Gesture recognizer to the stack layout and add the tap gesture. You can handle the event for tapping or bind it via command if you are using MVVM.
来源:https://stackoverflow.com/questions/38991845/button-with-2-images-and-text-in-xamarin-forms