Image Size, Image Button Placement for Xamarin Forms Labs

I have Xaml using Xamarin Forms Labs. Images are too small and the text is centered. I am trying to get the images a bit bigger, but the ImageHeightRequest attributes do not seem to be affected. I also tried several combinations of StackLayout formatting, such as HorizontalOptions = "StartAndExpand" only in StackLayout, as well as elements. This causes the buttons to shrink on the left side and are not wide enough to display the entire text of the button. Does anyone know how to implement this with large images and everything is left aligned? I know that the images are larger because I am transferring this from Windows Phone to Xamarin, and the same images are larger on Windows Phone. I also tried using the regular Xamarin Forms Image image button, which displays images of the same size

 <StackLayout Spacing="0"  >

<Label>
  <Label.FormattedText>
    <FormattedString>
      <FormattedString.Spans>
        <Span Text="My Label" ForegroundColor="#5C85FF" Font="Large"/>
      </FormattedString.Spans>
    </FormattedString>
  </Label.FormattedText>
</Label>

<controls:ImageButton Text="Button 1" BackgroundColor="#5C85FF" TextColor="#ffffff" HeightRequest="90" WidthRequest="175" Image="Image1.png" Orientation="ImageToLeft"  ImageHeightRequest="85" ImageWidthRequest="100" Clicked="ScanProductClicked"  />

<controls:ImageButton Text="Button 2" BackgroundColor="#5C85FF" TextColor="#ffffff" HeightRequest="90" WidthRequest="175" Image="Image2.png" Orientation="ImageToLeft"  ImageHeightRequest="85" ImageWidthRequest="100" Clicked="ShopProductsClicked"  />

<controls:ImageButton Text="Button 3" BackgroundColor="#5C85FF" TextColor="#ffffff" HeightRequest="90" WidthRequest="175" Image="Image3.png" Orientation="ImageToLeft"  ImageHeightRequest="85" ImageWidthRequest="100" Clicked="ShoppingListsClicked"  />

<controls:ImageButton Text="Button 4" BackgroundColor="#5C85FF" TextColor="#ffffff" HeightRequest="90" WidthRequest="175" Image="Image4.png" Orientation="ImageToLeft"  ImageHeightRequest="85" ImageWidthRequest="100" Clicked="LogInClicked"  />

<controls:ImageButton Text="Button 5" BackgroundColor="#5C85FF" TextColor="#ffffff" HeightRequest="90" WidthRequest="175" Image="Image5.png" Orientation="ImageToLeft"  ImageHeightRequest="85" ImageWidthRequest="100" Clicked="SettingsClicked"  /> </StackLayout>
+4

Source: https://habr.com/ru/post/1570504/


All Articles