나는 모든 기본 설정을 가진 table-cell을 가지고있다. 그리고 왼쪽의 ImageView에 이미지를 놓았고 TextLabel에 임의의 텍스트를 넣었습니다.iPhone에서 UITableViewCell의 이미지 뷰 고정?
아래의 방법으로 셀 높이를 조정합니다.
- (CGFloat)를 tableView (jQuery과 *)를 tableView heightForRowAtIndexPath (NSIndexPath *) indexPath
문제는 좌측 이미지 뷰의 프레임 사이즈가 다른 셀의 높이에 의존이다.
아래 사진을 보면 4 번째 셀의 높이가 다른 것보다 크고 다른 이미지와 약간 닮았습니다.
이 문제의 원인은 무엇이며 어떻게 해결할 수 있습니까 ??
-이 내 cellForRowAtIndexPath 방법입니다을 추가했다.
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefaultt reuseIdentifier:CellIdentifier] autorelease];
}
cell.textLabel.numberOfLines = 0;
cell.textLabel.text = [self GetSelectionForRowAtIndexPath:indexPath];
NSString *path = [[NSBundle mainBundle] pathForResource:@"icon_notSelected" ofType:@"png"];
UIImage *theImage = [UIImage imageWithContentsOfFile:path];
cell.imageView.image = theImage;
이렇게하면 셀에 높이를 더 넣어도 imageView가 커지지 않습니다. 테이블의 각 셀에 이미지를 표시 할 경우 (NSIndexPath *) indexPath
: (jQuery과 *)있는 tableView cellForRowAtIndexPath : (있는 UITableViewCell *)있는 tableView -이 코드를 넣어
물론, 저는 cellForRowAtIndexPath 메소드로 이미지를로드했습니다. 결과는 그 것입니다. – SeniorLee