Xamarin.Forms: Button in TabbedPage -
how add button other page on code (this part of 1 card in tabbedpage):
this.children.add(new contentpage { title = "text", content = new stacklayout { padding = 20, verticaloptions = layoutoptions.fillandexpand, children = { new image { source = imagesource.fromfile("image.png") }, new label { textcolor = color.fromhex("#5f5a5a"), fontsize = 16, text = "other text" } } } });
thanks help.
is understood issue right, need button in tab? this.children.add(new contentpage { title = "text", content = new stacklayout { padding = 20, verticaloptions = layoutoptions.fillandexpand, children = { new image { source = imagesource.fromfile("image.png") }, new label { textcolor = color.fromhex("#5f5a5a"), fontsize = 16, text = "other text" } } } }); this.children.add(new contentpage { title = "button", content = new stacklayout { children ={ new button{ image = imagesource.fromfile("button.png"), backgroundcolor = "transparent" } } } });
alternatively can use tap gesture recognizer
var button = new image { }; button.gesturerecognizers.add (new tapgesturerecognizer (sender => { }));
Comments
Post a Comment