How can I animate a MAUI Border from a fixed width to full width (HorizontalOptions=Fill) ? #33048
-
2025-12-08.18-52-47.mp4I am trying to animate a Border the same way as shown in this video. The problem is that I don’t know the maximum width, because the border is inside a Grid where I use margins to control its final size. Since the layout width is determined dynamically at runtime, I cannot calculate the exact value. How can I animate the border from WidthRequest = 50 to the equivalent of HorizontalOptions="Fill" when the actual “fill width” is unknown? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
|
Well, I guess you know the width of its parent and the size of Margin. So the final would be, for example, Parent.Width - Margin.Right. |
Beta Was this translation helpful? Give feedback.
-
|
UiElement.Width return perfect value after the UiElement Fully Loaded on Screen. <Border Loaded="GoogleLoginBorder_OnLoaded"/>private async void GoogleLoginBorder_OnLoaded(object? sender, EventArgs e)
{
await Task.Delay(500);
var border = (Border)sender;
Console.WriteLine(border.Width);
Console.WriteLine(border.Height);
} |
Beta Was this translation helpful? Give feedback.
UiElement.Width return perfect value after the UiElement Fully Loaded on Screen.