2017-05-03 41 views
0

我已經在Xamarin中創建了一個ListView,我有一個自定義渲染器將其呈現爲分組的UITableView。問題在於頂部標題佔據了空間。如何刪除Xamarin C#中的空白空間(空白)? 我在swift和objective-c中看到了一個解決方案,但我不知道如何翻譯它。UITableView分組刪除Xamarin中的頂部邊距

這是斯威夫特的解決方案:

var frame = CGRect.zero 
frame.size.height = 1 
tableView.tableHeaderView = UIView(frame: frame) 

如何在C#做什麼?

+0

你介意把你的自定義渲染代碼爲分組實現代碼如下位置:https://stackoverflow.com/questions/47851691/xamarin-forms-how-to-make-ios -listview-native-grouped-style-with-headers我有一個賞金,因爲我無法讓它爲我工作。 – SolidSnake4444

回答

1

試試這個:

var frame = CGRect.Empty; 
frame.Height = 1; 
MyStuffTableView.TableHeaderView = new UIView(frame);