First Tap on customcell of uitableview should expand it and second should contract it.

Posted by neha on Stack Overflow See other posts from Stack Overflow or by neha
Published on 2010-05-11T12:33:15Z Indexed on 2010/05/11 14:24 UTC
Read the original article Hit count: 501

Hi all,

In my application I have this requirement that first tap on custom cell of uitableview with a label in it should expand it and second should contract it. I'm able to expand and contract cell and expand label inside cell, but not able to contract the label on second tap.

I'm using this function

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {

[super setSelected:selected animated:animated];
if( selected == YES ) {
    [self expandRow];
}
else {
    [self contractRow];
}

height = [lblFeed frame].size.height + 75;
}

expandRow expands the label and contractRow contracts it. I'm perplexed as for how many rows this function gets called. It doesn't get called only for the cell tapped, it gets called more number of times for single tap on single cell may be for other cells but I'm not getting which rows.

This' really urgent.

Can anybody please help?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk