我创建了一个自定义单元格jQuery(document).ready(function($){
$(".lightbox-trigger").click(function(){
console.log( $(this).data('large-thumb') );
console.log( $(this).html() );
});
});
,并使用以下代码在标题视图中将其添加为PVIssueTypeSectionHeaderCell
的子视图:
ContentView
但是,自定义单元格的宽度不会自动调整大小,如下图所示。
这是在iPad横向模式和iPhone纵向模式下:
此版本处于iPad纵向模式:
如何让自定义单元格自动调整其宽度?
答案 0 :(得分:0)
我终于通过ContentView
直接返回自定义单元格GetViewForHeader
来使其成功。
public override UIView GetViewForHeader(UITableView tableView, nint section)
{
var cell = (PVIssueTypeSectionHeaderCell)tableView.DequeueReusableCell(HeaderCellKey);
if(cell == null)
{
cell = PVIssueTypeSectionHeaderCell.Create();
}
cell.ViewModel = this.GroupedIssueTypesFilter.ElementAt((int)section);
return cell.ContentView;
}