ImageButton with CornerRadius is not calculated as expected on Android when Padding exists
See original GitHub issueDescription
Trying to create a circular ImageButton, I am setting the CornerRadius half the width of the control, but on Android it does not appear as expected. If I remove the Padding it works, but it should also work with padding.
On iOS, MacCatalyst and Windows it works fine, however the text inside the ImageButton is not aligned exactly at the center of the ImageButton and appears a little blurry.
This is the code that creates the ImageButton
<ImageButton
x:Name="AddItemImageButton"
HorizontalOptions="End"
VerticalOptions="End"
CornerRadius="25"
WidthRequest="50"
HeightRequest="50"
BackgroundColor="DodgerBlue"
Padding="8,8,8,8" >
<ImageButton.Source>
<FontImageSource FontFamily="OpenSansRegular" Color="White" Glyph="+" />
</ImageButton.Source>
</ImageButton>
Check the reproduction project.
Steps to Reproduce
Just run the reproduction project targeting Android. The ImageButton will not appear as a circle.
Link to public reproduction project repository
https://github.com/YiannisBourkelis/maui_issues/tree/main/src/CornerRadiusIssue
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android, Windows, macOS
Affected platform versions
Android Emulator - Pixel 5 - Api 33
Did you find any workaround?
No.
Relevant log output
No response
Issue Analytics
- State:
- Created 10 months ago
- Reactions:1
- Comments:11 (3 by maintainers)
Top Results From Across the Web
android - Padding not working on ImageButton
this issue about scaleType default, in the ImageButton that is fitXY, you just need to change fitCenter. <ImageButton android:layout_width="24dp ...
Read more >R.attr | Android Developers
Quickly bring your app to life with less code, using a modern declarative approach to UI, and the simplicity of Kotlin. ... Start...
Read more >How To Create Round Buttons in Xamarin Forms
This article is about how you can easily create your own round buttons with a few simple lines of XAML, no code and...
Read more >androidx.compose.material
Executes when the user tries to dismiss the Dialog by clicking outside or pressing the back button. This is not called when the...
Read more >Xamarin.Forms 4.4.0.991537 (4.4.0 Service Release 3) ...
The existing Image control now supports rendering GIF images. This is intended for small, short animations. Caching and streaming is not ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

any updates on this basic thing? It was right on XF!!
@YiannisBourkelis can you attach a screen shot please?