-
Notifications
You must be signed in to change notification settings - Fork 1.9k
ImageButton Padding not working when manipulate IsVisible On Android #16713
Copy link
Copy link
Closed
Labels
area-controls-buttonButton, ImageButtonButton, ImageButtonmigration-compatibilityXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-ConvertXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convertplatform/androids/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working
Milestone
Description
Description
If IsVisible of the ImageButton or IsVisible of another View on the same level as the ImageButton changes, the Padding of the ImageButton is disabled.
<AbsoluteLayout>
<ImageButton
AbsoluteLayout.LayoutFlags="PositionProportional"
AbsoluteLayout.LayoutBounds="0.5,0.5,120,120"
Source="dotnet_bot.png"
WidthRequest="120"
HeightRequest="120"
CornerRadius="60"
Padding="30"
Aspect="AspectFit"
BackgroundColor="Beige"
IsVisible="true"
x:Name="imageButton"/>
<ContentView
AbsoluteLayout.LayoutFlags="SizeProportional"
AbsoluteLayout.LayoutBounds="0,0,1.0,1.0"
BackgroundColor="#80FFFFFF"
IsVisible="true"
x:Name="overlay"
/>
</AbsoluteLayout> public MainPage()
{
InitializeComponent();
Dispatcher.DispatchDelayed(TimeSpan.FromSeconds(3), () =>
{
overlay.IsVisible = false;
// workaround
//this.ForceLayout();
});
}| Before | After |
|---|---|
![]() |
![]() |
Steps to Reproduce
- Arrenge an ImageView and any other View on the same parent layout .
- Manipulate IsVisibleProperty of either.
- ImageView Padding disabled.
Link to public reproduction project repository
https://github.com/muak/Maui.ImageButtonIssue
Version with bug
8.0.0-preview.7.8842
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms, Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android13
Did you find any workaround?
This can be avoided by calling Page's ForceLayout.
Relevant log output
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-controls-buttonButton, ImageButtonButton, ImageButtonmigration-compatibilityXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-ConvertXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convertplatform/androids/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't workingSomething isn't working

