2012-01-16 70 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; 
} 
相關問題