iPad의 테이블보기 셀에있는 버튼에 이상한 문제가 있습니다.셀의 버튼이 iPad에서 응답하지 않습니다.
는 여기에 더 나은 이해를위한 두 개의 스크린 샷입니다 (버튼이 오른쪽에 흰색 배경 색상을 가지고) :
아이폰에 아무 문제지만,에 iPad이 단추가 응답하지 않습니다. 위치가 올바르게 표시된 것처럼 올바르게 배치 된 것 같습니다.
이
가있는 UITableViewCell 내 사용자의 코드입니다 :rightButton = [UIButton buttonWithType:UIButtonTypeCustom];
[rightButton setContentMode:UIViewContentModeCenter];
[rightButton setBackgroundColor:[UIColor whiteColor]];
int xPos = buttonWidth-rightButton.frame.size.width;
[rightButton setFrame:CGRectMake(xPos, 0, buttonHeight, buttonHeight)];
[self.contentView addSubview:rightButton];
//buttonWidth = 310, buttonHeight = 60
이미지와 대상 다른 클래스에 의해 설정됩니다
[cell.rightButton setImage:[UIImage imageNamed:@"options.png"] forState:UIControlStateNormal];
[cell.rightButton addTarget:self action:@selector(showOptions:) forControlEvents:UIControlEventTouchUpInside];
가 나는 또한 셀에 모든 요소를 배치 한 후이 시도
[self.contentView bringSubviewToFront: rightButton];
버튼이 최상위인지 확인하십시오.
작동하지 않았습니다.
이것에 대한 아이디어가 있습니까?
여전히 해결책을 찾지 못했습니다.
나는 그 동안 무슨 짓을 :
- 다른 모든 셀
다른 아이디어를 객체에
'UIButton'을'UITableViewCell'에 추가 한 방법과'UIButton'에 대한 동작을 어떻게 설정하는지 코드를 보여주십시오. – holex
자세한 내용을 제공하거나 단추 작성 코드를 작성할 수 있습니까? – Nilesh
내 게시물을 코드로 업데이트했습니다. –