locked
Problem with ListView border in iOS RRS feed

  • Question

  • User379603 posted

    Hello everyone, I have a simple problem that I can't see where I'm making it wrong, the border between items on my listview has a Margin on the left side that I don't want, can anyone give me some light? Below is the Image and the XAML.

    EDIT: I just realized it just have this margin on iOS, on Android is working great.

        <?xml version="1.0" encoding="utf-8" ?>
        <ContentPage
            x:Class="AirSenseApp.View.PlacesMenuPageX"
            xmlns="http://xamarin.com/schemas/2014/forms"
            xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
            xmlns:b="clr-namespace:Corcav.Behaviors;assembly=Corcav.Behaviors"
            Title="Locais">
            <b:Interaction.Behaviors>
                <b:BehaviorCollection>
                    <b:EventToCommand Command="{Binding AppearingCommand}" EventName="Appearing" />
                </b:BehaviorCollection>
            </b:Interaction.Behaviors>
            <ContentPage.ToolbarItems>
                <ToolbarItem
                    Command="{Binding CreatePlaceCommand}"
                    Icon="plusIcon.png"
                    Order="Primary"
                    Priority="1" />
            </ContentPage.ToolbarItems>
            <ContentPage.Content>
                <ScrollView>
                    <StackLayout VerticalOptions="CenterAndExpand">
                        <ListView ItemsSource="{Binding PlacesList}">
                            <ListView.ItemTemplate>
                                <DataTemplate>
                                    <ViewCell>
                                        <ViewCell.View>
                                            <StackLayout
                                                HeightRequest="60"
                                                HorizontalOptions="StartAndExpand"
                                                Orientation="Horizontal">
                                                <Grid>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="0.2*" />
                                                        <ColumnDefinition Width="1*" />
                                                        <ColumnDefinition Width="1*" />
                                                    </Grid.ColumnDefinitions>
                                                    <Image
                                                        Grid.Column="0"
                                                        Aspect="AspectFill"
                                                        HeightRequest="50"
                                                        Source="{Binding ImageResourceId}"
                                                        VerticalOptions="Center"
                                                        WidthRequest="50" />
                                                    <Label
                                                        Grid.Column="1"
                                                        FontAttributes="Bold"
                                                        FontSize="Large"
                                                        Text="{Binding name}"
                                                        VerticalTextAlignment="Center" />
                                                    <Label
                                                        Grid.Column="2"
                                                        FontAttributes="Bold"
                                                        FontSize="Large"
                                                        HorizontalOptions="EndAndExpand"
                                                        Text="23°C 49%"
                                                        VerticalTextAlignment="Center" />
                                                </Grid>
                                            </StackLayout>
                                        </ViewCell.View>
                                    </ViewCell>
                                </DataTemplate>
                            </ListView.ItemTemplate>
                        </ListView>
                        <Button
                            Command="{Binding ClearDBCommand}"
                            Style="{StaticResource acessButtonStyle}"
                            Text="Limpar BD" />
                    </StackLayout>
                </ScrollView>
            </ContentPage.Content>
        </ContentPage>
    

    Thursday, January 10, 2019 11:50 AM

Answers

  • User379603 posted

    Found the solution, sorry for the post:

    https://forums.xamarin.com/discussion/101175/listview-separator-full-width-ios https://docs.microsoft.com/es-es/xamarin/xamarin-forms/platform/platform-specifics/consuming/ios

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, January 10, 2019 12:09 PM