다른 사람들과 마찬가지로 UITableViewCell 클리핑을 사용하여 동일한 문제가 발생했습니다. 다른 사람이 올바르게 지적한대로 셀의 contentView에 새로운 수퍼 뷰가 있습니다.iOS 7 UITableViewCell 클립 TEMPORARILY
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *cellIdentifier = @"HomeTableViewCell";
ItemCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if(!cell)
{
cell = [[ItemCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
//add views here as subviews to cell.contentView. Set them tags and retrieve later.
}
cell.clipsToBounds = FALSE;
cell.layer.masksToBounds = FALSE;
cell.contentView.clipsToBounds = FALSE;
cell.contentView.layer.masksToBounds = FALSE;
cell.contentView.superview.clipsToBounds = FALSE;
cell.contentView.superview.layer.masksToBounds = FALSE;
[self loadCell:cell inTable:tableView atIndexPath:indexPath];
return cell;
}
loadCell: inTable: atIndexPath:
태그에 의해 셀의 서브 뷰를 검색하고 적절한 내용을로드 : 그래서 나는이했다. 괜찮아. clipToBounds
또는 layer.masksToBounds
에 대한 다른 언급이 없습니다. 하지만 : 내가 선택한 셀을 다시로드하면, 임시로 클립이 경계에 도달 한 다음 위의 코드에 도달하여 올바르게 가져옵니다. 그래서 약 1-2 초 동안 나는 세포를 잘랐다. 이것은 ItemCell
내부에서 일어나는 일입니다. 방금이 클래스를 만들어 clipToBounds
속성을 TRUE로 바꾸는 것을 확인했습니다.
@implementation ItemCell
- (id) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
if((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]))
{
[self addObserver:self forKeyPath:@"layer.masksToBounds" options:NSKeyValueObservingOptionNew context:nil];
[self addObserver:self forKeyPath:@"clipsToBounds" options:NSKeyValueObservingOptionNew context:nil];
}
return self;
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
NSNumber *nr = [change objectForKey:@"new"];
if(nr.intValue)
{
self.clipsToBounds = FALSE; // STAY FALSE!!
self.layer.masksToBounds = FALSE;
}
}
TRUE로 설정하면 FALSE로 설정 되더라도 클리핑/언 클립 사이의 간격은 여전히 유지됩니다. 그것은 단지 작습니다. 그것은 iOS6에서 발생하지 않았습니다. clipsToBounds
속성이 true로 전환 할 때 스택 추적, 당신은 CALayer setMasksToBounds
가 자동으로 호출되는 것을 볼 수 있습니다
사람이 어떤 수정의 어떤 생각을 가지고 있습니까? 고맙습니다!
나는 비슷한 문제가 있다고 생각한다. – djskinner
해결책을 찾으면 알려주십시오. 나는 지금까지 아무 것도 얻지 못했고, 많은 프로젝트를 진행했고, 작은 결함은 관리자가 '받아 들일 수있는'것으로 선언 했으므로 더 이상 작업하지 않았습니다. 그러나 나는 여전히 호기심이 많다. – George