开发者

How do I make image view disappear from screen

I want to make image view disappear from screen.开发者_运维百科 I don't want to release it. How can I do that?


Simple.

[myImageView setHidden:YES];

UIView documentation is here: http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIView_Class/UIView/UIView.html

From the docs:

hidden

A Boolean value that determines whether the receiver is hidden. @property(nonatomic, getter=isHidden) BOOL hidden Discussion

Setting the value of this property to YES hides the receiver and setting it to NO shows the receiver. The default value is NO.

A hidden view disappears visually 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. The hiding of subviews is handled implicitly by the system and does not cause the value in the hidden property of those views to change.

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 but the receiver may still be hidden if an ancestor is hidden.


@Steve has the same answer just different syntax. I have only ever used the syntax below.

myView.hidden = YES;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜