简体   繁体   English

全屏图像预览

[英]Full Screen Image Preview

有人可以告诉我如何在有人点击笔尖的图像视图时获得全屏图像预览视图吗...就像appstore应用程序屏幕截图中的那个一样。...这将是真正的帮助...在此先感谢

The first thing you need to do is subclass UIImageView. 您需要做的第一件事是UIImageView的子类。

Then in your subclass make sure that user interaction is enabled (either by setting it in code, or by checking the box in IB). 然后,在您的子类中,确保启用了用户交互(通过在代码中进行设置或通过选中IB中的复选框)。

Then you need to override the touches:DidBeginWithEvent: (et al) methods (they're found in UIResponder), and put the code for what you want to happen inside them. 然后,您需要重写touches:DidBeginWithEvent:(等)方法(可在UIResponder中找到),然后将要发生的事情的代码放入其中。 For example, you could create a larger image view, and then attach it to the view hierarchy. 例如,您可以创建一个较大的图像视图,然后将其附加到视图层次结构。

As for making it completely fullscreen, you'd need to set the frame of the image view to that of the Window, and hide any Tab Bars, Navigation Bars, Status bars, etc. 为了使其完全全屏显示,您需要将图像视图的框架设置为窗口的框架,并隐藏任何选项卡栏,导航栏,状态栏等。

You can hide the status bar by using 您可以使用以下方法隐藏状态栏

[[UIApplication sharedApplication] setStatusBarHidde:YES];

Hide navigation bars: 隐藏导航栏:

[navigationController setNavigationBarHidden:YES];

so on and so forth. 等等等等。 You should be able to find ways to hide most things by looking at their docs. 您应该能够通过查看文档来找到隐藏大多数内容的方法。

Hope this helps. 希望这可以帮助。

我实际上想要一个控件,例如照片中的图像预览以及在Facebook上的图像预览...。我在开源Three20存储库中找到了该控件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM