1
votes

I have implemented TableView for Settings page in Xamarin Cross Platform app. In this height of each cell is fixed and is not expending depending on View inside. ViewCell displays items fine if its is single or double line height. If there are multiple controls (like button+2 labels or Label containing paragraph) then its height is limited and the view is not displayed.

<TableSection Title="Settings heading">

                <ViewCell>

                    <!--  Image Type Settings  -->
                    <StackLayout HorizontalOptions="StartAndExpand"
                                 Orientation="Vertical"
                                 VerticalOptions="StartAndExpand">
                        <StackLayout HorizontalOptions="Fill"
                                     Orientation="Horizontal"
                                     VerticalOptions="StartAndExpand">
                            <Label HorizontalOptions="StartAndExpand" Text="Key" />
                            <Label HorizontalOptions="EndAndExpand"
                                   Text="Value"
                                   TextColor="Green" />
                        </StackLayout>
                        <Label HorizontalOptions="Fill"
                               Text="---- Long Long Paragraph here about setting, of which only one line will be rendered in ViewCell ----"
                               VerticalOptions="StartAndExpand" />
                    </StackLayout>
                </ViewCell>
 </TableSection>

I have tried increasing height of ViewCell, TableView VerticalOptions but nothing come out.

1

1 Answers

4
votes

I later found that TableView has property HasUnevenRows and should be set to true

 HasUnevenRows="True"