I have two content views one after the other, were one view is with fixed height and the other view should fill and expand the parent view.
I have tried the following things :
Using 2 content view inside a StackLayout, with vertical options as "End".
<StackLayout Orientation="Vertical" VerticalOptions="End" Spacing="0" >
<ContentView x:Name="red_ContentView" BackgroundColor="Red" VerticalOptions="FillAndExpand">
</ContentView>
<ContentView x:Name="blue_ContentView" BackgroundColor="Blue" HeightRequest="66">
</ContentView>
</StackLayout>
I want the white space in the image to be filled with red_ContentView.
As noted above, using VerticalOptions="FillAndExpand" on the StackLayout might get you what you want.
An alternative is to use Grid instead of StackLayout, something like this:
<Grid VerticalOptions="FillAndExpand">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="66"/>
</Grid.RowDefinitions>
<ContentView x:Name="red_ContentView" BackgroundColor="Red" Grid.Row="0">
</ContentView>
<ContentView x:Name="blue_ContentView" BackgroundColor="Blue" Grid.Row="1">
</ContentView>
</Grid>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With