Repository navigation
Closed
Labels
area-controls-frameFramefixed-in-7.0.100fixed-in-7.0.101fixed-in-7.0.81Look for this fix in 7.0.81!fixed-in-8.0.0-preview.1.7762Look for this fix in 8.0.0-preview.1.7762!p/1Work that is important, and has been scheduled for release in this or an upcoming sprintpartner/cat π»this is an issue that impacts one of our partners or a customer our advisory team is engaged withplatform/androidt/bugSomething isn't working
Milestone
Description
Frame issue on Android
I use a Frame -Control with image to display an avatar. On iOS everything works as expected (Image1). On Android, the dimensions of the frame do not fit (Image2).
The really funny thing is that when using a Border control, the behavior is the other way around. Border works on Android but not on iOS.
<Frame
BorderColor="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray950}}"
CornerRadius="25"
HeightRequest="50"
WidthRequest="50"
IsClippedToBounds="True"
HorizontalOptions="Start"
VerticalOptions="Start">
<Image Source="{Binding UserProfileImage}" VerticalOptions="Center" HorizontalOptions="Center"
Aspect="AspectFill"
HeightRequest="50"
WidthRequest="50">
<Image.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_PowerProfile" CommandParameter="{Binding UId}" NumberOfTapsRequired="1" />
</Image.GestureRecognizers>
</Image>
</Frame>Steps to Reproduce
https://github.com/ManfredRohleder/FrameIssueAndroid
Link to public reproduction project repository
...
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 13
Did you find any workaround?
No response
Relevant log output
No response
Reacted by Satoshi NaKamura
Metadata
Metadata
Assignees
Labels
area-controls-frameFramefixed-in-7.0.100fixed-in-7.0.101fixed-in-7.0.81Look for this fix in 7.0.81!fixed-in-8.0.0-preview.1.7762Look for this fix in 8.0.0-preview.1.7762!p/1Work that is important, and has been scheduled for release in this or an upcoming sprintpartner/cat π»this is an issue that impacts one of our partners or a customer our advisory team is engaged withplatform/androidt/bugSomething isn't working


Activity
mr5z commentedon Feb 21, 2023
Just noticed you specify the size in both controls. I think the most common way is to specify it on the Image control only. Let me know how it goes.
Visual-IT-2021 commentedon Feb 21, 2023
@mr5z
Without the size specification in the frame the behavior in the Android platform is even worse. The frame is even larger.
mr5z commentedon Feb 22, 2023
@Visual-IT-2021 that shouldn't be the case. I think they should address that issue too.
omegazero2310 commentedon Feb 23, 2023
You can workaround by using this NuGet package : PureWeen.Maui.FixesAndWorkarounds
and call
builder.ConfigureMauiWorkarounds();in MauiProgram.csBecause the fix is not backported to .Net 7 yet (currently the fix is on .Net 8 Preview 1)
ManfredRohleder commentedon Feb 23, 2023
Found a fix for this.
if you wrap a VerticalStacklayout with WidthRequest and HeightRequest (same as the image) around the Frame it works.
To reproduce this, open a new maui project, add a image and paste the code into mainpage.
ManfredRohleder commentedon Feb 23, 2023
You can find a repro here: https://github.com/ManfredRohleder/FrameIssueAndroid
sesitosvdx commentedon Feb 23, 2023
In your case where you want to surround an Image with a border I would suggest you use a Border (MAUI exclusive) with StrokeShape="Ellipse" instead of Frame (migrated to ease transition from XF).
I had many Frames like these on my XF app and after migration to MAUI they were all causing problems (which increased after last release). So finally decided to stop using Frame and changed them all for Border (which is a more versatile and powerfull component) and it solved my problems.
5 remaining items
PureWeen commentedon Mar 20, 2023
I tested this sample on the latest branch and it looks like it's fixed on Android
It's broken on windows still, but I'll open a new issue for windows.
PureWeen commentedon Mar 20, 2023
@Visual-IT-2021 I tested the sample here with Border, and for me, it works the same on all three platforms. If you're having an issue with Border still, can you log an issue?