UITableViewCell - displaying accessory view beside rearrange control - iphone

In the Safari bookmarks manager on iPhone, the UITableView seems to have behaviour that isn't standard. I'm referring to this:
alt text http://cl.ly/b7f0faead6a8586d3470/content
In edit mode, the bookmark UITableViewCells have both a rearrange control and a UITableViewCellAccessoryDisclosureIndicator accessory view next to them. How do you get both? In my table views, when you go into edit mode to reveal the rearrange control, the control takes the place of the accessory view, it doesn't display both.

Use editingAccessoryType property of UITableViewCell.

Related

Disclosure Indicator and Detail Disclosure

I have a table view cell, which is acting like button, performing some action without additional user interface presentation, then it will update the same cell with results of action. What type of accessory would be appropriate for such cells?
I would like to know in which cases I should use the subject types.
If you are keeping the cell in place, without any navigation, but will update the contents of the cell I don't think you need any disclosure accessory there. The flash as the cell is selected and deselected - and of course the change in the cell's visible content - should be enough. It would be more misleading in my opinion to show a disclosure indicator, with its implications of navigation, and then to remain in place.

iPhone UI controls

Which class is used to create the clickable sections(with > arrow) and the checkbox list on last shot?
alt text http://developer.apple.com/iphone/library/documentation/uikit/reference/UINavigationController_Class/Art/navigation_interface.jpg
Have a look at the UINavigationController.
To create the list with arrows, use the UITableView and set the Accessory "Disclosure indicator" on the cell (in the Interface builder).
The screenshot is from the Settings application though. If you want to create subpanels for settings, you need to use a different approach (Here is one example)
UITableView (UITableViewController).
The checkmarks and arrows are added by changing the .accessoryType property of the cell. To make the table views clickable, implement the -tableView:didSelectRowAtIndexPath: method in the delegate.

UITableView footer appearing in middle of screen because of keyboard

I have added a custom footer to a tableview using viewForFooterInSection
I display a alertprompt where I get user input via a UITextField so the keyboard appears but when I press OK and the screen refreshes (via statement[self.tableView reloadData];)
my footer is displaying ABOVE where the keyboard used to be so displaying in the middle of my tableview instead of at the bottom of the screen.
How do I get the keyboard to disappear BEFORE the footer redraws so I don't have the footer in the middle of the screen??
According to Text and Web Programming for iPhone OS: Managing the Keyboard: Moving Content That Is Located Under the Keyboard:
Note: As of iOS 3.0, the UITableViewController class automatically resizes and repositions its table view when there is in-line editing of text fields. See “View Controllers and Navigation-Based Applications” in Table View Programming Guide for iOS.
It sounds like the table view responds to the keyboard appearing/disappearing regardless of whether the text field is inside the table view. File a bug. If you make your own UIViewController subclass which manages its own table view, you can probably work around the bug.
You're also slightly misled: reloadData doesn't "redraw the footer".

How to change disclosure style when user enters in edit mode of a UITableView?

I have a UITableView that in 'normal' mode, show a UITableViewCellAccessoryDisclosureIndicator meaning if the user taps the row, another list is showed, like HIG says:
"Disclosure indicator. When this
element is present, users know they
can tap anywhere in the row to see the
next level in the hierarchy or the
choices associated with the list item.
Use a disclosure indicator in a row
when selecting the row results in the
display of another list. Don’t use a
disclosure indicator to reveal
detailed information about the list
item; instead, use a detail disclosure
button for this purpose."
When the user tap the edit button in the top bar of the UITableView, I think I have to change the disclosure because if the user tap it, a view for changing the information of the current row is showed (see the bold line above), again, like HIG says:
"Detail disclosure button. Users tap
this element to see detailed
information about the list item. (Note
that you can use this element in views
other than table views, to reveal
additional details about something;
see “Detail Disclosure Buttons” for
more information.)
In a table view, use a detail
disclosure button in a row to display
details about the list item. Note that
the detail disclosure button, unlike
the disclosure indicator, can perform
an action that is separate from the
selection of the row. For example, in
Phone Favorites, tapping the row
initiates a call to the contact;
tapping the detail disclosure button
in the row reveals more information
about the contact."
Have I miss understood the HIG, or I really do have to change the disclosure style in edit mode of UITableView? If yes, how I can intercept the edit mode when the user taps the Edit button?
Thanks in advance.
you do not need to manually change the disclosure indicator as the user switches in and out of edit mode. You can control what is displayed in edit mode by setting the "editingAccessoryType" property for the table cell. You would usually set that up in the tableView:cellForRowAtIndexPath method along with the "accessoryType" property which sets the disclosure indicator for the normal (non-editing) state.
From the table view programming guide:
accessoryType and accessoryView—Allows you to set one of the standard accessory views (disclosure indicator or detail disclosure control) or a custom accessory view for a cell in normal (non-editing) mode. For a custom view, you may provide any UIView object, such as a slider, a switch, or a custom view.
editingAccessoryType and editingAccessoryView—Allows you to set one of the standard accessory views (disclosure indicator or detail disclosure control) or a custom accessory view for a cell in editing mode. For a custom view, you may provide any UIView object, such as a slider, a switch, or a custom view. (These properties were introduced in iPhone OS 3.0.)

Segmented Control to change views

I have created an up/down arrow segmented control button on the right side of the navigation bar in my detail view. In a table based application, how can I use these up/down arrows to move through cells in the parent table?
The apple "NavBar" sample code has an example of this but the controls are not functional.
The iBird program has this functionality as well and it is very nice. Download the "iBird 15" program for free.
Any thoughts?
Thanks!
Set the segmented control to momentary mode, and set the control's action for UIControlEventValueChanged to point to your view controller. Then your view controller can change the selection in the table, or whatever it is you're doing with tables. (I'm not sure if you're using a UITableView or something else.)