2016-05-07 31 views

回答

13

是的,你可以刪除部分動態執行以下操作:

XAML:

<TableView x:Name="Table"> 
    <TableSection x:Name="Section"> 
     <TextCell Text="something"/> 
    </TableSection> 
    <TableSection x:Name="Section2"> 
     <TextCell Text="something2"/> 
    </TableSection> 
</TableView> 

代碼背後:

Table.Root.Remove(Section); 

- 或 -

Table.Root.Remove(0); //If you know the index of the section 

如果您需要將它添加回來點,請務必將其存放在你的代碼的變量後面像這樣取出前:

TableSection section = Table.Root[0]; 

- 或 -

TableSection section = Table.Root.IndexOf(Section); 
+0

哇。非常感謝。它工作正確。 –

+0

@BrightLee沒問題,很高興幫助。 – hvaughan3

+0

@ hvaughan3-在我的情況下,我想從節中動態地移除一個開關單元。有什麼辦法嗎? – SoftSan

相關問題