我的目标是让UITableViewCells在接近UITableView的边界时淡入/淡出并即将被覆盖/显示.
我一直在尝试的方法是在滚动事件期间获取UITableViewCell的坐标.问题是每个细胞似乎都是0,0.我已经尝试将坐标转换为父表和视图,但它们仍然出现在0,0.
所以一般来说,如果有人知道如何获得坐标,或者根据他们的位置更好地将UITableViewCells放入和取出,我会非常感谢您的任何建议.
谢谢你的时间,乔尔
我试图在一个单元UITableView格内截取屏幕截图,但附加代码我只能截取单元格界限.问题在于UIGraphicsBeginImageContextWithOptions(rect.size,YES,0.0f).我只能制作rect大小的截图,不能控制rect和的起源
rect = [cell bounds].所以请建议我一些想法.
{
UITableViewCell* cell = [self.tableView cellForRowAtIndexPath:path];
__block CGRect rect = [cell bounds];
UIGraphicsBeginImageContextWithOptions(rect.size,YES,0.0f);
CGContextRef context = UIGraphicsGetCurrentContext();
[cell.layer renderInContext:context];
UIImage *capturedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
}
Run Code Online (Sandbox Code Playgroud)