Does "Margin" really exists?

According to this, since V2.0 of Forms all Views implement the Margin property, but I'm on V2.1 and it does not exist, compiler throws error and designer doesn't recognize it.

Does it really exist? If yes, what's the minimum version to use it?

Thanks

Best Answers

Answers

  • agustingimenez.1966agustingimenez.1966 USMember ✭✭

    That makes sense.

    Thanks a lot.

  • NMackayNMackay GBInsider, University mod
    edited June 2016

    Yep, turned up in 2.2.0.31 stable. A very welcome addition as a lot of layout controls can be junked now in pages.

    <Grid Grid.Row="0" RowSpacing="0">
          <StackLayout Orientation="Vertical" VerticalOptions="CenterAndExpand" HorizontalOptions="FillAndExpand"
                       Padding="10,0,0,0">
            <Label Text="{Binding Position.Address}"
                   VerticalOptions="Center"
                   HorizontalOptions="Start">
              <Label.FontSize>
                <OnPlatform x:TypeArguments="x:Double"
                            iOS="20"
                            Android="22" />
              </Label.FontSize>
            </Label>
          </StackLayout>
        </Grid>
    
    

    Much easier now :smile:

        <Grid Grid.Row="0" RowSpacing="0">
          <Label Text="{Binding Position.Address}"
                  VerticalOptions="Center"
                  Margin="10,0,0,0"
                  HorizontalOptions="Start">
            <Label.FontSize>
              <OnPlatform x:TypeArguments="x:Double"
                          iOS="20"
                          Android="22" />
            </Label.FontSize>
          </Label>
        </Grid>
    
    
Sign In or Register to comment.