Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Set rectangle's values to AutoSize in XAML?

$
0
0

Hello,

How do I set rectangle values to Auto in XAML?

Here's an example of what I want to achieve in XAML, the shorter syntax I can get the better.

var label = new Label();
AbsoluteLayout.SetLayoutBounds(label, new Rectangle(Point.Zero, new Size(AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize)));

XAML:

<!-- Doesn't compile -->
<Label AbsoluteLayout.LayoutBounds="0,0,Auto,Auto" />

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>