使用蒙版时,UITableView无法正常工作 [英] UITableView doesn't work fine when I use mask
问题描述
我的Tableview仅加载4个单元格,但我有25个单元格...从tableview滚动到25 Itens,但是这些单元格清晰...单元格的背景是白色的,从5到25的单元格都是透明的背景色和空的...我确实在[listaPins计数]中设置了一个断点,并且确实有25个itens ..
My Tableview load only 4 cells but I have 25 cells in count...The scroll from tableview scroll to 25 itens, but The cells are clear...the background from cells are white and from cell 5 to 25 are all clear color background and empty... I did put a breakpoint in [listaPins count] and really has 25 itens..
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [_listaPins count];
}
仅拨打4次
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
编辑 我确实发现我在注释此代码,该tableview正常工作.但是这怎么了?
EDIT I did discovery that I comment this code, the tableview works fine. but whats wrong with this?
UIBezierPath *maskPath;
maskPath = [UIBezierPath bezierPathWithRoundedRect:_tbFeeds.bounds byRoundingCorners:(UIRectCornerTopLeft | UIRectCornerTopRight) cornerRadii:CGSizeMake(9.0, 9.0)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = _tbFeeds.bounds;
maskLayer.path = maskPath.CGPath;
_tbFeeds.layer.mask = maskLayer;
[maskLayer release];
推荐答案
代码看起来很完美.遮罩时,请检查表格的框架.尝试记录它.休息一切都很好.
The code looks perfect. Please check the frame of Table at the time of masking. try to log it. Rest everything looks ok.
这篇关于使用蒙版时,UITableView无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!