문제

테이블 뷰 셀을 원합니다. 당신이 탭하면 높이가 자라게되어 텍스트를 보여줍니다.다시 탭하면 덜 높이 버전으로 돌아갑니다.이게 가능하며 그렇다면 어떻게해야합니까?미리 감사드립니다

도움이 되었습니까?

해결책

Use

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

--

In

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

when the user taps on a row, set the new row height in an array somewhere, then call tableview reload to redraw. It will call cellForRowAtIndexPath and since you know which cell has a large height, you return the larger cell for that row, and heightForRowAtIndexPath will ensure it is displayed correctly.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top