[英]uitableview inside uiscrollview storyboard
所以我在情節UIScrollView
中有一個UIScrollView
在情節UIScrollView
中也有一個UITableView
。 關鍵是我想在滾動視圖中放入該UITableView
多個實例。 但我得到一個錯誤
unable to dequeue a cell with identifier Cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard
那么如何解決這個問題呢?
提前致謝!
好! 這是我的代碼:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"DayCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
[self configerCell:cell atIndexPath:indexPath];
return cell;
}
我在情節提要中給一個單元一個標識符...
這就是我將UITableView添加到UIScrollView的方法:
UITableViewController *tableView = [[UITableViewController alloc] initWithStyle:UITableViewStyleGrouped];
[self.mainScroll addSubview:tableView.view];
我認為您的tableview單元格需要一個標識符。 嘗試單擊表格視圖單元格,然后在屬性檢查器下方有一個名為Identifier
的字段。 檢查一下!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.