如何在点击时隐藏 uitoolbar

发布于 2024-09-13 06:28:38 字数 130 浏览 2 评论 0原文

我有一个带有按钮的 uitoolbar,单击该按钮会将 uiwebview 的图像捕获到照片存储中。 是否可以让按钮在单击时隐藏,然后在捕获代码完成后重新出现。我使用界面生成器创建了按钮。不希望工具栏显示在捕获的图像中。提前感谢您提供的任何帮助。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

失而复得 2024-09-20 06:28:38

我不确定我是否完全理解你的问题,但你可以很容易地隐藏和显示 UIButtonUIButtonUIView 的子类,它具有 hidden 属性。所以它可能就像设置一样简单: myButton.hidden = YES;

来自 Apple 的文档:

隐藏视图从其窗口中消失并且不接收输入事件。然而,它仍然保留在其父视图的子视图列表中,并像往常一样参与自动调整大小。隐藏带有子视图的视图具有隐藏这些子视图及其可能具有的任何视图后代的效果。此效果是隐式的,不会改变接收者后代的隐藏状态。

隐藏窗口当前第一响应者的视图会导致该视图的下一个有效关键视图成为新的第一响应者。

此属性的值仅反映接收器的状态,并不考虑视图层次结构中接收器祖先的状态。因此,如果接收者由于祖先被隐藏而被隐藏,则此属性可以为 NO。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文