Forum Xamarin.Forms

Listview Binding Label not displaying on iOS Project but working on Android?

SodiKZ125SodiKZ125 Member ✭✭
edited July 2019 in Xamarin.Forms

Hey i am facing an issue with my current list view which has two labels which display a title and subtitle. i have this working in Android but when i run the iOS project these two labels are not showing. I have added another label to the DataTemplate with the text of Hello World and that is showing on iOS as well as the fontawesome icon. Does anybody know why this is happening?

Here is my XAML:

    `<ListView x:Name="UpcomingJobsList" ItemTapped="UpcomingList_ItemTapped" SeparatorVisibility="Default" HasUnevenRows="False" RowHeight="85">
                            <custom:CustomViewCell SelectedItemBackgroundColor="Pink">
                                <Grid Padding="20, 20, 20, 20">
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="*" />
                                        <RowDefinition Height="15" />
                                        <RowDefinition Height="*" />
                                    <Label Text=" hello world" TextColor="Black" />
                                    <Label Text="{Binding Destination}" Grid.Column="0" Grid.Row="0" HorizontalTextAlignment="Start" TextColor="#C8C8C8" FontAttributes="Bold" FontSize="12" />
                                    <Label Text="{Binding Name}" Grid.Column="0" Grid.Row="1" HorizontalTextAlignment="Start" TextColor="Black" FontSize="16" FontAttributes="Bold" />
                                    <Label Text="&#xf105;" TextColor="#09C887" VerticalTextAlignment="Center" HorizontalTextAlignment="End" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" FontSize="22">
                                            <OnPlatform x:TypeArguments="x:String" Android="fa900.ttf#Font Awesome 5 Free Solid" iOS="Font Awesome 5 Free" />

And here is my code behind (List View is just a basic list)

    `public class UpcomingJobsData
            public string Name { get; set; }
            public string Destination { get; set; }

    var jobdata = new List<UpcomingJobsData>();

            jobdata.Add(new UpcomingJobsData()
                Name = "Petstore",
                Destination = "LINCOLN > DERBY"

            jobdata.Add(new UpcomingJobsData()
                Name = "Simple Business Supplies",
                Destination = "LINCOLN > DERBY"

            jobdata.Add(new UpcomingJobsData()
                Name = "DFDS Seaways",
                Destination = "LINCOLN > DERBY"

            UpcomingJobsList.ItemsSource = jobdata;`
Sign In or Register to comment.