Repository navigation
How can I animate a MAUI Border from a fixed width to full width (HorizontalOptions=Fill) ? #33048
Answered
by
RedEye-Developers
RedEye-Developers
asked this question in
Q&A
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? |
Answered by
RedEye-Developers
Dec 9, 2025
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. |
5 replies
|
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);
} |
0 replies
Answer selected by
RedEye-Developers
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
UiElement.Width return perfect value after the UiElement Fully Loaded on Screen.