Skip to content

ImageButton CornerRadius not being applied on Android #23854

Open
@Schinwinkwinsky

Description

@Schinwinkwinsky

Description

I'm trying to create a circle ImageButton. I got successful with Button. But applying CornerRadius on ImageButton, it works on Windows but not on Android.

On Windows:
image

On Android:
image

Page xaml file:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="BaladaCerta.Maui.Views.Pages.EventsPage"
             Shell.NavBarIsVisible="False">

    <Grid RowDefinitions="auto,auto,auto,auto,*">
        <Grid ColumnDefinitions="auto,*,auto" Padding="10">
            <Button
                Style="{StaticResource CircleButton}"
                Text="{StaticResource menu}"
                FontFamily="FontAwesomeSolid"
                FontSize="20" />
            <ImageButton
                Grid.Column="2"
                Style="{StaticResource CircleImageButton}"
                Source="foto.jpg"
                Aspect="AspectFill" />
        </Grid>
    </Grid>
</ContentPage>

Styles file:

    <Style TargetType="Button" x:Key="CircleButton">
        <Setter Property="HeightRequest" Value="50" />
        <Setter Property="WidthRequest" Value="50" />
        <Setter Property="CornerRadius" Value="50" />
        <Setter Property="TextColor" Value="White" />
        <Setter Property="Background" Value="#1AFFFFFF" />
    </Style>

    <Style TargetType="ImageButton" x:Key="CircleImageButton">
        <Setter Property="HeightRequest" Value="50" />
        <Setter Property="WidthRequest" Value="50" />
        <Setter Property="CornerRadius" Value="50" />
    </Style>

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.3 GA

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

Labels

area-controls-buttonButton, ImageButtonplatform/androids/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions