Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Xamarin.Forms;
- namespace ListViewDemoVS
- {
- class MyContentPage : ContentPage
- {
- public MyContentPage()
- {
- Padding = new Thickness(0, Device.OnPlatform(20, 0, 0), 0, 0);
- ListView listView = new ListView()
- {
- ItemTemplate = new DataTemplate(typeof(ListItemCell)),
- BackgroundColor = Color.Black,
- HasUnevenRows = true,
- IsPullToRefreshEnabled = true,
- ItemsSource = new ListItem[]
- {
- new ListItem { Title = "First", Description = "1st" },
- new ListItem { Title = "Second", Description = "2nd" },
- new ListItem { Title = "Third", Description = "3rd" },
- new ListItem { Title = "Fourth", Description = "4th" },
- new ListItem { Title = "Fifth", Description = "5th" },
- new ListItem { Title = "Sixth", Description = "6th" },
- new ListItem { Title = "Seventh", Description = "7th" },
- new ListItem { Title = "Eighth", Description = "8th" },
- new ListItem { Title = "Ninth", Description = "9th" },
- new ListItem { Title = "Tenth", Description = "10th" },
- new ListItem { Title = "Eleventh", Description = "11th" },
- new ListItem { Title = "Twelfth", Description = "12th" },
- new ListItem { Title = "Thirteenth", Description = "13th" },
- new ListItem { Title = "Fourteenth", Description = "14th" },
- new ListItem { Title = "Fifteenth", Description = "15th" },
- new ListItem { Title = "Sixteenth", Description = "16th" },
- new ListItem { Title = "Seventeenth", Description = "17th" },
- new ListItem { Title = "Eighteenth", Description = "18th" },
- }
- };
- this.Content = listView;
- }
- }
- }
Add Comment
Please, Sign In to add comment