Re: [iPhone] UITableView with state?
Re: [iPhone] UITableView with state?
- Subject: Re: [iPhone] UITableView with state?
- From: Luke the Hiesterman <email@hidden>
- Date: Mon, 11 May 2009 15:17:28 -0700
reloadData is potentially fine. Presumably, though, you really only
have one cell you need to reset (the one that was tapped to cause you
to animate in another view), so all you need to do is reset that cell.
Again, probably easy to keep around a reference to that cell, and you
could do whatever resetting you require in viewDidAppear:.
Luke
On May 11, 2009, at 3:12 PM, Eric E. Dolecki wrote:
Actually now that I think about it, I wouldn't really need to keep
the cell selected, as I plan on displaying another view at that
time, so the initial UI change itself will be okay... but how do I
reset the view with the table in it so that all the cell reset
themselves? reloadData?
E
On Mon, May 11, 2009 at 5:48 PM, Luke the Hiesterman <email@hidden
> wrote:
First of all, it's generally discouraged as a UI design to allow
cells to stay selected. That is, inside your
tableView:didSelectRowAtIndexPath: method, you should call
[tableView deselectRowAtIndexPath:indexPath animated:YES] so that
you get the nice animated highlight fade-away that people expect in
an iPhone app. If, for some reason, you feel you need to keep the
cell selected, it seems simple enough to keep around a reference to
the last selected cell. Then, inside your
tableView:didSelectRowAtIndexPath: method you could perform whatever
changes you need to format the coloring of the formerly selected
cell back to normal, and finally set your reference to the cell that
has just been selected.
Luke
On May 11, 2009, at 2:16 PM, Eric E. Dolecki wrote:
I am using my own graphics for a tableview's cell background and
selected
background (grouped tableview). I am using UILabels added to the
contentView, so I'm not setting the cell text directly at all. I
have tagged
the labels (3 in each cell) so I can get to them later within the
selection
callback method.
I can easily get the current section and row. However I'd like to be
able to
get the previous selected cell to be able to reset it's UI. What do
I mean?
The selected cell background is dark so I need to switch the texts
to white
from black. But this means I need to reset the previous cells labels
to
black again.
What's a good way to do this? Does that information come along for
the ride
on the callback method for cell selection? Do I need to reset the
cells
somehow and then change the text colors? It seems I have to
implement some
sort of state to have this happen, or else there is an approved
established
way to so this already.
Thanks,
Eric
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
http://ericd.net
Interactive design and development
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden