简体   繁体   中英

xamarin.forms - Change the view of a button by a gridlayout

Is there a way to replace the view/layout of a button by a gridlayout to change its look and of course keeping behaviours? The gridlayout would be composed of a label and images.

Thanks a lot

Yes you can but you won't keep all behaviours like click. What you can do is add a Tap event to the grid.

var grid = new Grid();
var tapGestureRecognizer= new TapGestureRecognizer();
tapGestureRecognizer.Tapped += (s, e) => {
    // handle the tap
};
grid.GestureRecognizers.Add(tapGestureRecognizer);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM