[英]How to use popover view as Collapsible view on click of tableview cell
[英]popover display on tableview cell
我在我的應用程序中使用TableView時,當我單擊一個表格單元格時我想要一個彈出視圖,表格Cell中的所有內容都應該顯示在彈出視圖中,所以請建議我怎么做?
我下面有一些示例代碼不起作用..所以建議使用代碼,我希望單元格中的所有內容都顯示在彈出視圖中。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UIView *aView = [[UIView alloc] init];
UIPopoverController *popoverController = [[UIPopoverController alloc]
initWithContentViewController:aView];
popoverController.popoverContentSize = CGSizeMake(320, 416);
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
[popoverController presentPopoverFromRect:cell.bounds inView:cell.contentView
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
用這個
[popoverController presentPopoverFromRect:[cell frame] inView:cell.contentView
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
然后檢查。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.