Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

ImageButton

$
0
0

I am trying to use an ImageButton in a StackLayout and attempting to set the text of the button to be set below the image. However, the text is always displayed on the right side of the image instead of below.... here is the code:

<?xml version="1.0" encoding="utf-8" ?>
<StackLayout x:Class="MyApp.Portable.Controls.MyNavigationControl"
             xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:controls="clr-namespace:XLabs.Forms.Controls;assembly=XLabs.Forms"
             xmlns:forms="clr-namespace:Xamarin.Forms;assembly=Xamarin.Libraries.PCL"
             x:Name="MyNavControl"
             BackgroundColor="White"
             HorizontalOptions="FillAndExpand"
             MinimumHeightRequest="75"
             Orientation="Horizontal">
  <StackLayout.Resources>
    <ResourceDictionary>
      <Style x:Key="NavButtonStyle" TargetType="Button">
        <Setter Property="BackgroundColor" Value="White" />
        <Setter Property="TextColor" Value="Gray" />
        <Setter Property="FontSize" Value="7" />
      </Style>
    </ResourceDictionary>
  </StackLayout.Resources>
  <forms:ImageButton x:Name="GpsButton"
                        Clicked="GpsBUttonClicked"
                        Image="GPS_Icon_Light_Gray_sm.png"
                        MinimumHeightRequest="75"
                        Orientation="ImageOnBottom"
                        Style="{StaticResource NavButtonStyle}"
                        Text="GPS"
                        VerticalOptions="Start" />
<StackLayout>

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>