Issue

I make app for android in VS2015. I want to make a grid layout like upper image.
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="30*" />
<ColumnDefinition Width="70*" />
</Grid.ColumnDefinitions>
<Image x:Name="BackImage" Source="{Binding ImageName}" Grid.Column="0"/>
<Grid.RowDefinitions>
<RowDefinition Height="50*"/>
<RowDefinition Height="50*"/>
</Grid.RowDefinitions>
<Grid Grid.Column="1" Grid.Row="0">
<Label Text="Text1"/>
</Grid>
<Grid Grid.Column="1" Grid.Row="1">
<Label Text="Text2"/>
</Grid>
</Grid>

I draw image before divide row. But image is only draw in row 0 like this. I want to use row no.0&1 like 1 row.
Solution
what you're looking for is this:
<Image x:Name="BackImage" Source="{Binding ImageName}" Grid.Column="0" Grid.RowSpan="2"/>
RowSpan, and ColumnSpan, instruct the Grid layout system that you want the object to span over multiple rows, or columns.
declaring the image before the RowDefinitions won't change anything.
Answered By - Stephane Delcroix
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.