所以,这是我的看法:的UITableView不会滚动
,这是我的UITableViewDelegate和DataSource
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 20;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"course"];
cell.textLabel.text = [NSString stringWithFormat:@"%i" ,arc4random() % 10];
cell.detailTextLabel.text = [NSString stringWithFormat:@"%i" ,arc4random() % 10];
return cell;
}
这是结果:
问题是,UItableView不滚动。决不。我真的不知道为什么... 有人可以帮助我吗?
您在结果中显示的标题图像(时钟),您如何实现该功能?它覆盖了桌面视图吗? – mkral
我以编程方式实现,不,它不覆盖tableView。 –
那么如果你确定你编写的头文件UIView的框架没有比预期的大,并且覆盖了tableview,那么肯定还有别的东西在进行。你有没有做过任何改变,你认为可能是问题? tableview是scrollview的一个子类,所以它应该可以工作。 – mkral