質問

私はテーブルビューセルを望みます。もう一度タップすると、それはより高いバージョンではないバージョンに戻ります。これが可能です、そしてそれであれば私はそれをどのように達成するのでしょうか?事前にありがとう

役に立ちましたか?

解決

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