2012-01-16 67 views
2

我正在使用披露指标来显示我的tableview单元格的详细说明。我用配置详细披露指标

[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator] 

来调用系统指示器。我的问题是如何自定义展示位置?目前它是从右到大约10px,我想将它放在屏幕右边缘20px处。我可以以编程方式设置它,还是必须放置自定义图像? 帮助,将不胜感激。谢谢。

回答

2

如果你不喜欢的标准视图展示位置,你将不得不使自己的资产,并使用IB或与自己把他们:

[cell addSubView:myCustomDisclosureView]; 
+1

还有其他方法吗? – 2013-11-13 07:52:00

1

在iOS中8,你可以玩layoutMargins

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 

    UIEdgeInsets layoutMargins = self.tableView.layoutMargins; 
    layoutMargins.right = 20.0f; 

    self.tableView.layoutMargins = layoutMargins; 
} 
相关问题