IOS:UITableViewCell
The UITableViewCell class defines the attributes and behavior of the cells that appear in UITableView objects. This class includes properties and methods for setting and managing cell content and background (including text, images, and custom views), managing the cell selection and highlight state, managing accessory views, and initiating the editing of the cell contents.
Touch Animation Trouble
커스텀 UITableViewCell
에서 Touch할 경우 Touch Down Animation에서 정지되어있을 경우가 있다.
| -> | |
이런 경우 아래의 Override method를 확인해 본다.
아래와 같은 코드를 주석처리해야 한다.
Hight of UITableViewCell
UITableView의 Cell높이를 변경할 수 있는데, 두 가지 방법이 있다. 한 가지는 대부분 책에서 소개하는 heightForRowAtIndexPath 메소드를 사용하는 방법 나머지는 rowHeight 프로퍼티에 값을 넣어주는 것인데, 효과가 다르다. heightForRowAtIndexPath 를 사용하여 높이를 변경하는 방법은, 각 셀마다 높이를 다르게 줄 수도 있다. 인자로 indexPath가 넘어오기 때문에.... 일괄적으로 변경하려면 물론 상수를 리턴하면 된다. 하지만 이렇게만 하면, 만약 cell이 하나도 없을 경우에는 heightForRowAtIndexPath 메소드에서 리턴하는 높이가 아닌, 기본 테이블뷰의 높이가 되어버린다. 즉, heightForRowAtIndexPath에서 내가 70을 높이로 줬는데, cell이 하나도 없으면, 높이가 40이 되어버린다는 뜻이다. 이럴 경우 rowHeight의 값도 70으로 해주면 cell이 하나도 없는 경우에도 빈 cell의 높이가 70이 된다. 즉, rowHeight는 기본 높이이고, heightForRowAtIndexPath는 각 셀마다 다르게 높이를 적용할 경우에 사용하면 된다.
Transparency Background
배경화면에 투명색상을 적용하고 싶을 경우 아래와 같이 적용하면 된다.
정확한 정보는 아니지만 iOS7부터 투명 배경색상을 별도로 지정해야 한다.
See also
Favorite site
- UITableViewCell Class Reference
- iPhone 8강 - 테이블뷰5 - Custom Cell 1
- Creating Custom UITableViewCell using Nib (.xib) files in XCode 2