Tuesday, 15 February 2011

xaml - Designing image gallery in xamarin.forms -


I have a JSON that has image thumbnail URLs and some text to present as an image gallery such as a phone gallery . I did a lot of research about the grid layout but there was no way to speed up the number of grid widths fixed width and height to display the images. Can anyone tell me what would be the best component to create a gallery type page with a number of images?

There is a gallery control in Xamarin. Doodle Please see sample -

If it is not what you are looking for then you can use your own with pictures. And vacancies You can show the full image See sample list view with images in Xamarin.form examples.

If you need multiple stack layouts in horizontal rendering, and in the sequences of that list, maybe 3.

that you have 3 columns and unlimited scrolling rows.

Edit: You must create a view modal in which there will be a class with the public property that you want to bind. Avatar your JSON in an IEnumerable of this ViewModel class and tie it in your list view. In it, you have to use

to create an image because you have written it from the URL, the following syntax will help you:

  webImage.Source = new UriImageSource { Uri = new Uri ("http://xamarin.com/content/images/pages/forms/example-app.png"), caching enabled = true, CacheValidity = new timespan (5,0,0,0,0,0) };  

Binds a ListView with an image and 2 label .

Class Employee Employee: ViewSell {Public Employee Cell () {var image = new image {horizontal option = layout options. Start}; Image.SetBinding (Image.SourceProperty, New Compulsive ("ImageUri")); Image.WidthRequest = image.HeightRequest = 40; Var nameLayout = CreateNameLayout (); Var viewLayout = New StackLayout () {Orientation = Stack Orientation. Horizontal, child = {image, name layout}}; View = View Layout; }}

Edit 2: If you have variable URLs in the Create URL, then you will go ahead for one. The tableview is not bound to the data source and you can parse the JSON object and create individual cells according to your requirement. That is: Each JSON object will be a TableSection and each image will be a ImageCell


No comments:

Post a Comment