Button on some android platforms shows border / shadow?

GeorgeMCeaserJrGeorgeMCeaserJr ✭✭USMember ✭✭
edited November 2016 in Xamarin.Forms

I have the following style declared in my App.Xaml

            <Style TargetType="Button">
                <Setter Property="BorderWidth" Value="-2" />
                <Setter Property="BackgroundColor" Value="Transparent" />
                <Setter Property="BorderColor" Value="Transparent" />
                <Setter Property="BorderRadius" Value="0"/>
            </Style>

I have verified the controls on my page are using this style by changing the BackgroundColor to red. When I run a page with the following buttons declared,

    <StackLayout  Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="gvButtons" VerticalOptions="Start" HorizontalOptions ="FillAndExpand" Margin="0,0,0,-4" Orientation="Horizontal">
<Button x:Name="btnRate" Grid.Column="0" Grid.Row="0" Clicked="btnRate_Clicked" HeightRequest="32"
                                  HorizontalOptions="CenterAndExpand" VerticalOptions="Center" Image="smallstar.png" Text="{ext:Translate Rate}"
                                  TextColor="Black" FontSize="Micro" FontAttributes="Bold" />   
<Button x:Name="btnMap" Grid.Column="1" Grid.Row="0" Clicked="btnMap_Clicked" HeightRequest="32"
                                            HorizontalOptions="CenterAndExpand" VerticalOptions="Center" Image="map.png" Text="{ext:Translate Map}"
                                            TextColor="Black" FontSize="Micro" FontAttributes="Bold" />
    <Button x:Name="btnCLosed" Grid.Column="2" Grid.Row="0" Clicked="btnCLosed_Clicked" HeightRequest="32"
                                            HorizontalOptions="CenterAndExpand" VerticalOptions="Center" Image="closed.png" Text="{ext:Translate Closed}"
                                            TextColor="Black" FontSize="Micro" FontAttributes="Bold" />

they come out with some sort of border around then as seen in the attached file. Any suggestions?

Answers

  • Jesse_JiangJesse_Jiang ✭✭✭ USMember ✭✭✭

    Maybe caused by Android Theme and style, nothing with Xamarin.Forms.

  • GeorgeMCeaserJrGeorgeMCeaserJr ✭✭ USMember ✭✭

    So how can I ensure that on every android device the buttons have no type of border around them. In API 19 Androids there are none. Only on the Samsung Galaxy S5.

Sign In or Register to comment.