我有一個UIScrollView
,裏面有一個小的UITableView
。在iOS-7
一切正常,但在iOS-6
表視圖根本不顯示,完全不可見。 一切都被實例化,委託和數據源方法被調用,但UITableView
只是沒有出現。空白空間,沒有別的。UITableView在IOS7中可見,但在IOS6中不可見
任何人都有任何想法,爲什麼這可能會發生?
更新:
這只是與原生細胞原生的UITableView。
下面是一些示例代碼:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [_gridTableData count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *gridCellId = @"gridCellID";
UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:gridCellId];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:gridCellId];
[cell.textLabel setFont:[UIFont fontWithName:@"HelveticaNeue" size:12]];
[[cell textLabel] setText:_gridTableNames[[indexPath row]]];
[cell.detailTextLabel setFont:[UIFont fontWithName:@"HelveticaNeue" size:12]];
[[cell detailTextLabel] setText:_gridTableData[[indexPath row]]];
}
return cell;
}
如果你可以張貼一些截圖,你的代碼和你在模擬器中看到的東西都會很好!你可能在某處丟失了某些東西! –
我希望我可以,但我沒有必要的聲望,我使用一個新的帳戶。只要我能夠,我會張貼截圖。無論如何,在ios6中只有一個黑色空間,完全消失:/ – 6rod9
嘗試使用一些日誌語句來打印出1. tableview框架的大小,2. scrollview框架和3.滾動視圖的內容大小。第二件事是蘋果強烈阻止嵌套滾動視圖。即:不要在滾動視圖中放置tableview。如果可能,我建議你簡單地使用自定義頁眉和頁腳視圖製作一個tableview。 – mrosales