How can I make buttons wrap around like in a tag cloud with Xamarin Forms?

后端 未结 3 910
温柔的废话
温柔的废话 2021-01-21 18:05

I have code like this:


   
      
      
3条回答
  •  野的像风
    2021-01-21 19:06

    You can achieve this following the guide provided by the xamarin forms developers site at https://developer.xamarin.com/guides/xamarin-forms/user-interface/layouts/custom/

    The problem you described is exactally what the sample code this guide shows. Creating a custom layout you can reuse this solution everywhere you need it.

    Succinctly, what you have to do to create your WrapLayout:

    1. Implement the methods to handle the children arrangemeant
    2. Provide bindable properties to personalize the use on each need
    3. Consume it as you wish

    You may get results like this:

提交回复
热议问题