Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

pwturben

macrumors newbie
Original poster
Jan 27, 2010
11
0
Hello.

my problem:


I have and UITableView. This table have some rows.
I wanted to implement deleting rows usin this method:



At first, i have and "edit" button on the left of UINavigation bar.
I have a method connected to this button, he has a string:
(ComplaintsTable - its my UITableView)

[ComplaintsTable setEditing:YES animated:YES];

when im pressing "Edit" button, starts standart animation, and (-) red icons appeared. All is ok.
8add0767f026.jpg


Notice, that i have label with "Yesterday" text. < its date


Then, when im pressing (-) button - its become (|) button, and "Delete" button appears:
adb613df8b47.png


look - my Yesterday label is under "Delete" button. I need to hide that.
Of course i cant make it smaller and hide under delete, coz there will be any text of any size and any length.


My problem is.
Im trying to Hide this label with text "Yesterday"

I want to hide this label when i press (-) button.
How can i handle event, when (-) - red button in some cell is pressed ?


Thanks

p.s.:its like a standart mechanism in "SMS" or other. Hiding date when u are editing some row.
 
The table will automatically resize your cell when the delete button appears. You need to set the autoResizingMask for the label. I have one that's like this and seems to work

Code:
label.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleWidth;
 
yeah. Some magic with label width, and with the bit mask of AutoResising mask and all works great!

Thanks. Hope its a good implementation. But who can judge winners?label is hidden!:D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.