views:

67

answers:

1

I have a uitoolbar with a button that when clicked captures a image of a uiwebview to the photos storage. Is it possible to have the button hide onclick and then reappear after the capture code has finished.I created the button with interface builder.Don't want the toolbar showing in the captured image.Thanks in advance for any help offered.

A: 

I'm not sure if I exactly understand your question, but you can hide and display a UIButton pretty easily. UIButton is a sub-sub-class of UIView, which has a hidden property. So it might be as simple as setting: myButton.hidden = YES;

From Apple's docs:

A hidden view disappears from its window and does not receive input events. It remains in its superview’s list of subviews, however, and participates in autoresizing as usual. Hiding a view with subviews has the effect of hiding those subviews and any view descendants they might have. This effect is implicit and does not alter the hidden state of the receiver’s descendants.

Hiding the view that is the window’s current first responder causes the view’s next valid key view to become the new first responder.

The value of this property reflects the state of the receiver only and does not account for the state of the receiver’s ancestors in the view hierarchy. Thus this property can be NO if the receiver is hidden because an ancestor is hidden.

Neal L
Sorry not really what i was looking for.need the tollbar(with buttons) to hide on touch and reappear after the code it is attached too finishes executing.
How2iphone
Ok... the OP asked about hiding the button. To hide a toolbar you can call `- (void)setToolbarHidden:(BOOL)hidden animated:(BOOL)animated` on your `UINavigationController` to show or hide the toolbar.
Neal L