iOS:模拟带变焦的 iPhone 相机胶卷
在我的应用程序中,我模拟 iPhone 的相机胶卷; 我有一个包含所有图像的 mainScrollView,对于每个图像,我都有一个 srollView 来缩放它。您知道可以用图像缩放每个页面,但是有没有办法让所有图像缩放为 1.5(例如);当我打开相机胶卷时,我想以变焦(例如 1.5)查看每张图像,这可能吗? 我尝试这个:
for (int i = 0;i<13;i++){
UIScrollView *scrollView = [[UIScrollView alloc]init];
scrollView = (UIScrollView *)[scrollV viewWithTag:i + SCROLL_TAG];
scrollView.maximumZoomScale = 1.35;
scrollView.minimumZoomScale = 1.35;
[scrollView setZoomScale:1.35];
[scrollView release];
}
但是这个代码只缩放第一张图像,我不知道为什么!!!
In my app I simulate camera roll of iPhone;
I have a mainScrollView with all image, and for every image I have a srollView to zoom it. You know that you can zoom every page with an image, but is there a way to have all image with zoom at 1.5 (for example); when I open camera roll I want to see every image with a zoom (1.5 for example) is it possible?
I try this:
for (int i = 0;i<13;i++){
UIScrollView *scrollView = [[UIScrollView alloc]init];
scrollView = (UIScrollView *)[scrollV viewWithTag:i + SCROLL_TAG];
scrollView.maximumZoomScale = 1.35;
scrollView.minimumZoomScale = 1.35;
[scrollView setZoomScale:1.35];
[scrollView release];
}
but this code zoom only first image, I don't know why!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我猜你可能需要的只是这个,因为最后的分配和释放只是多余的。除此之外,代码非常简单。
执行此操作后,请尝试在循环外部打印这些视图之一的缩放比例,以确保万无一失。
I'm guessing that all you would possibly need is just this, because the alloc and the release at the end are merely superfluous. beyond that the code is pretty much straight forward.
once you do this, try printing the zoomscale of one of these views outside the loop just to be sure.