有没有办法可以在iPhone SDK上进行覆盖视图? [英] Is there a way that I can make an overlay view on the iPhone SDK?

查看:73
本文介绍了有没有办法可以在iPhone SDK上进行覆盖视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在不同的iPhone应用程序(Skype,Phone.app(在通话时),Google Mobile)中看到了叠加视图的示例,我想知道如何在应用程序中执行相同的操作.

I've seen examples of overlay views in different iPhone apps (Skype, Phone.app (while making a call), Google Mobile) and I was wondering how I could do the same in an app.

我正在制作一个带有录音按钮的应用程序,当按下该按钮时,我想要一个外观漂亮的叠加层(类似于在iPhone上拨打电话时出现的叠加层视图),上面写着正在录制"并以秒为单位显示,并带有一个停止按钮.

I'm making an app which has a record button in it and when that button is pressed, I want a nice looking overlay (similar to the overlay view that appears when making a call on the iPhone) that says "Recording" with a count in seconds to appear along with a stop button.

是否有任何指南或其他可以帮助我做到这一点的东西?谢谢.

Is there any guide or anything I can look at to help me do this? Thanks.

我还想知道如何制作垂直长的视图,该视图要求用户用不是TableView的手指滚动.也谢谢.

Also I was wondering how I can make a vertically long view that requires the user to scroll with their finger that isn't a TableView. Also thanks.

推荐答案

我通常只是自己创建一个;它只是一个UIView,您可以在其他子视图上方插入它.

I usually just create them myself; it's just a UIView which you insert above your other subviews.

UIView *overlayView = [[UIView alloc] initWithFrame:self.view.frame];
overlayView.backgroundColor = [UIColor blackColor];
overlayView.alpha = 0.4;
[self.view addSubview:overlayView];
[overlayView release];

关于第二个问题,请查看UIScrollView.

As for your second question check out UIScrollView's.

这篇关于有没有办法可以在iPhone SDK上进行覆盖视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆