Share via

Maui for android create line issue

Haviv Elbsz 2,151 Reputation points
2023-11-27T11:29:13.5466667+00:00

Hello all. what parameters I need for a horizontal line across the layout width. Thank you.

<Line X1="40"
      Y1="0"
      X2="0"
      Y2="120"
      Stroke="Red" />
Developer technologies | .NET | .NET Multi-platform App UI
0 comments No comments

Answer accepted by question author

Anonymous
2023-11-28T05:34:22.36+00:00

Hello,

what parameters I need for a horizontal line across the layout width. Thank you.

You can bind x2 to the width of itself like following code.

 <Line Stroke="Red" X2="{Binding Width, Source={RelativeSource Self}}" HorizontalOptions="Fill" StrokeThickness="3" />

Best Regards,

Leon Lu


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.