Hey Community,
I'm pretty new to Xamarin.Forms and I'm strugeling in creating a coustom Button. The button should look like the following:
The Labels will be dynamically created in a loop and the button will be used multiple times in the view.
To create the Layout with a grid is no problem. It is just a 2x2 grid with two stacklayout in the 2.1 2.2 cell. My first Problem is to create the grid in the button and secondly to be abel to reuse the layout.
I'm very thankfull for your help!
Daniel
You cannot nest content in the button like you can in WPF.
You could add a tapgesture to the grid or whatever your container is and the InputTransparent to true on the child controls so the grid tap gesture gets triggered and you could execute a command from the tap gesture.
If I got what you are trying to achieve you don't realy need to use button. Create your own view with 'labels' in it and add GestureRecognizer to that view. So you'll get tap processing and desired appearance/functionality.
Answers
@wolfi1991
You cannot nest content in the button like you can in WPF.
You could add a tapgesture to the grid or whatever your container is and the InputTransparent to true on the child controls so the grid tap gesture gets triggered and you could execute a command from the tap gesture.
If I got what you are trying to achieve you don't realy need to use button. Create your own view with 'labels' in it and add GestureRecognizer to that view. So you'll get tap processing and desired appearance/functionality.
okay then I will try that
Thank you for your help! @NMackay @anton.emelyancev