English 中文(简体)
将触角活动通过到Situs Bar
原标题:Passing touch events to iOS status bar

I have a UIWindow with windowLevel set to UIWindowLevelStatusBar+1. This window has a single semi-transparent view that blocks the status bar. I need to sometimes pass touch events from the view on to the status bar. Any ideas?

最佳回答

因此,似乎可以采用以下一种习俗分类:IDWindow上下限:hit :with Event:, 人工检测次表中的接触点,并且总是返回零。

- (UIView*)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
    if ([event type]==UIEventTypeTouches) {
        UIView *v=[super hitTest:point withEvent:event];
        if (customSubViewthatCoversStatusBarOnly==v) 
            //doLotsOfCoolStuff
    }

    return nil;
}

地位酒吧承认所有接触点,因此不存在与滚动、再打电话、“声音”等分离。 而且,我仍然被拦截在地位路障上。

我现在赞扬这一点。 我本周晚些时候将可能把更新材料上载到应用程序库,其中更成熟的版本将显示,抱怨 Apple果会有多少起。

EDIT - 7th April:
Was approved by Apple. Works flawlessly.

问题回答

您可在>github 上找到这一组成部分。

否则,Cocoa with Love blog post is really help to be used may.

根据我的理解,你应使用<代码>-(IDView *)hit(CG Point)点与Event(IEvent*)event执行这种行为。 基本上,如果you希望处理触动事件或[超级打:点与Event:event],则你要么自发,要么让地位律师处理触动事件。

查阅 for more.

EDIT: 如前所述, Apple果可能无法批准。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签