HeightRequest sets a view’s requested height in .NET MAUI. Unlike the read-only Height property, it supplies a height value that layout can use. Values are expressed in device-independent units (DIUs), helping interfaces scale across displays with different resolutions and physical sizes. section 4.4.1
Use HeightRequest when you need consistent sizing or want to centralize visual dimensions:
- Read Height when you need the view’s resulting size; set HeightRequest when you want to request a size. section 4.4.1
- Prefer DIUs instead of pixel coordinates so a requested height remains suitable across different screen resolutions and sizes. section 4.4.1
- Put HeightRequest in a style when several controls should share the same height. section 10.1.1
Give every button a consistent height
In a Button style, add <Setter Property="HeightRequest" Value="50" />. The same style changes CornerRadius to 25 and MinimumWidthRequest to 100, producing consistently sized branded buttons on the LoginPage. section 10.1.1
