0

I'm fairly new to mobile development in C#, but I decided to dive into Xamarin.Forms to develop for the three major platforms at once. What I would like to do now is create a custom object that contains text, an image, and a button, and I would like to be able to create multiples of them depending on how many sets are present in my database. I aware of the ContentPage class and then saw that ContentView can only contain a single child element, so I'm not sure what type of class I would use in order to create a custom visual object. Ideally, I'd like to be able to do something like the image below: enter image description here

1 Answer 1

1

Take a look at the ListView class (API doc). It should do the trick. It's relatively straightforward to create a DataTemplate with a ViewCell that represents the UI for your collection of data objects, which you will then assign to the ListView's ItemsSource property. The result is a scrollable list that updates with your data source.

There are lots of benefits to using this component, including built-in pull-to-refresh, template re-use, and context actions.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.