1

現在、ストーリーボードに接続されたパーティクル ビューがあります。私が直面している問題は、このビューを表示すると同時にアラートを表示していることです。アラートは常にパーティクル ビューの前に表示されます。パーティクル ビューを常に前面に配置する方法はありますか? 私は SIAlertView という名前のサードパーティのアラート ライブラリを使用しているので、それが可能であると推測しています。

alertView の zPosition をログに記録しましたが、常に 0 なので、パーティクル ビューのレイヤーの zPosition を 10 に設定しましたが、アラート ビューの下にまだ表示されています。

ストーリーボードの階層は次のとおりです。

ここに画像の説明を入力

4

1 に答える 1

1

SIAlertView についてはわかりませんが、通常の UIAlertView は別ウィンドウで表示されます。それをオーバーラップさせたい場合は、zpozition を変更してもできません。別のウィンドウも使用する必要があります。

// do not forget to keep strong reference for it somewhere!
UIWindow *notificationWindow; 

//your frame here!
notificationWindow = [[UIWindow alloc] initWithFrame: some_cgrect];

notificationWindow.backgroundColor = [UIColor clearColor]; // your color if needed
notificationWindow.userInteractionEnabled = NO; // if needed

// IMPORTANT PART!
notificationWindow.windowLevel = UIWindowLevelAlert + 1; 

notificationWindow.rootViewController = [UIViewController new];
notificationWindow.hidden = NO; // This is also important!

アップデート:

ステータスバーも重ねるには

notificationWindow.windowLevel = UIWindowLevelStatusBar;

UIWindow を閉じるには、それへの強力なポインターを無効にするだけです。何かのようなもの:

self.strongPointerToYourWindow = nil;
于 2014-04-18T08:05:17.213 に答える