1
私はカスタムセルPVIssueTypeSectionHeaderCell
を作成し、このコードのヘッダビューでContentView
ためのサブビューとして追加:iOSのUITableViewHeaderFooterView.ContentViewサブビューで自動サイズ変更のカスタムセル幅
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);
var headerView = tableView.DequeueReusableHeaderFooterView(HeaderFooterViewKey);
if (headerView == null)
{
headerView = new UITableViewHeaderFooterView(HeaderFooterViewKey);
}
headerView.ContentView.AddSubview(cell);
return headerView;
}
しかし、カスタムセルの幅がありません以下の画像でわかるように、自動サイズ変更はしません。
これはiPadのランドスケープモードとiPhoneのポートレートモードである:
この1つはiPadのポートレートモードである間:にする方法
カスタムセルの幅は自動的に変更されますか?