![](/img/trans.png)
[英]How can I make a ContentPage with a StackLayout inside scrollable?
[英]Do I need to surround a <TableView> with a <StackLayout> in a <ContentPage>
我在開發人員具有<ContentPage>
且其中帶有<TableView>
的應用程序上工作。 這是需要/正常做法嗎? 我正在嘗試弄清楚開發人員為什么這樣做。
開發人員在<TableView>
周圍添加了一個元素
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Title="Network">
<ContentPage.Content>
<StackLayout>
<TableView>
...
</TableView>
</StackLayout>
</ContentPage.Content>
</ContentPage>
ContentPage只能有一個子元素。 包含某種Layout容器作為子容器並不少見,因此可以將多個子元素添加到頁面中。 但是,在這樣的情況下,實際上只有一個孩子,這可能是不必要的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.