Margin is not available

hey guys

Just wanted to check if we can use margin/padding in Xamarin Forms xaml page? I tried setting padding/spacing but it always throws exception.

Vinod

Posts

  • MitchMilamMitchMilam USMember ✭✭✭

    @VinodPrajapati can you show us your code?


  • <ListView.ItemTemplate>


    <ViewCell.View>

            <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
              <Image Source="{Binding ProfileImage}"
                     WidthRequest="40"
                     HeightRequest="40" VerticalOptions="Center" HorizontalOptions="Start"/>
    
              <StackLayout Orientation="Vertical" Grid.Column="1"
                           HorizontalOptions="StartAndExpand" Padding="0, 0, 0, 0">
                <Label Text="{Binding Name}"
                       HorizontalOptions="FillAndExpand" />
                        <Label Text="{Binding College}" 
                        HorizontalOptions="FillAndExpand"/>
                        <Label Text="{Binding Location}" 
                        HorizontalOptions="FillAndExpand"/>               
                         <Label Text="{Binding Points}"
                        HorizontalOptions="FillAndExpand"/>
    
              </StackLayout>
    
            </Grid>
          </ViewCell.View>
        </ViewCell>
      </DataTemplate>
    </ListView.ItemTemplate>
    

  • ItalKItalK USMember ✭✭

    Anyone know the answer?

Sign In or Register to comment.