uiwindow

How to add view in UIWindow?

為{幸葍}努か 提交于 2019-12-03 13:05:10
I wanted to add a view in UIWindow with following code: AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate; UIWindow *window = delegate.window; UIView *aView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)]; aView.backgroundColor = [UIColor blackColor]; [window addSubview:aView]; This code didn't work. I wanted to clone property of UIAlertView. It will pop over top of everything when we call [alertViewInstance show]; method. Tried this as well: UIView *aView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 100, 100)]; UIWindow* window = [UIApplication

UIStatusBarStyle changes after displaying a UIWindow over UIStatusBar

≡放荡痞女 提交于 2019-12-03 10:29:59
I am displaying a UIWindow over the UIStatusBar , by default the UIStatusBarStyle is set to UIStatusBarStyleLightContent , but when I display the UIWindow the UIStatusBarStyle switches to the black style. Tuslareb I came across this topic while struggling with the same problem. What you have to do is create a new view controller and set it as the root view controller of your UIWindow (that is the UIWindow that you are displaying over your other view). Then, in this new view controller implement the preferredStatusBarStyle method like this: - (UIStatusBarStyle) preferredStatusBarStyle { return

Passing touches between stacked UIWindows?

廉价感情. 提交于 2019-12-03 09:35:46
I have two windows -- a front one, and a back one. The front one is used to overlay some stuff on top of the back one. I want to be able to capture touches on some parts of the front window, but not others; I want the front window to receive touches in some areas, but pass them through to the back window in others. Any ideas as to how I'd do this? Anna Dickinson Ok, here's what I did: I created two views in the front window. The first view covered the area where I wanted to catch the touches; the second, where I wanted the touches to pass through. I sub-classed UIWindow and overrode the

iOS学习笔记:iOS应用程序的窗口元素及其运行原理

前提是你 提交于 2019-12-03 06:52:38
一、应用程序窗口元素 UIWindow:每一个应用程序都有属于自己的UIWindow,UIWindow继承自UIView UIView:视图,屏幕上可视的控件都是UIView,如按钮、文本标签、表格 UIViewController:控制器, 内部默认有一个UIView,负责控制UIView之间的切换、管理UIView的生命周期、装配数据到UIView上显示、处理UIView事件(相当于Android的Activity) 二、iOS应用程序项目目录结构 三、iOS应用程序的运行原理 1.首先执行main函数(程序的入口) 2.执行UIApplicationMain函数 3.UIApplicationMain函数,加载程序 1> 创建一个UIApplication实例。这个UIApplication对象是单例的,一个iOS程序对应一个UIApplication对象,UIApplication对象是应用程序的象征。 2> 开启一个消息循环(main loop),用来监听用户的操作 3> 在创建一个UIApplication的delegate对象,负责监听UIApplication对象的生命周期 delegate类需要实现UIApplicationDelegate协议 @interface AppDelegate : UIResponder <UIApplicationDelegate>

How did Vesper show users wallpaper without UIApplicationIsOpaque key?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 06:39:13
An app named Vesper was updated for iOS 7 and shows the user's wallpaper on iOS 7. I have found that using UIApplicationIsOpaque key and UIBackgroundStyleLightBlur can show the users background but will not pass validation. Vesper passed validation and passed Apple. I did upload this question to the dev forums, but apple has taken it down. Brent Simmons has written a blog post explaining it. It seems like they didn't use UIApplicationIsOpaque key. The Sidebar In 1.0 our sidebar menu included a bit of top and bottom padding to blend into the black of the status bar and — along with a touch of

UIWindow not showing over content in iOS 13

*爱你&永不变心* 提交于 2019-12-03 05:08:41
问题 I am upgrading my app to use the new UIScene patterns as defined in iOS 13, however a critical part of the app has stopped working. I have been using a UIWindow to cover the current content on the screen and present new information to the user, but in the current beta I am working with (iOS + XCode beta 3) the window will appear, but then disappear straight away. Here is the code I was using, that now does not work: let window = UIWindow(frame: UIScreen.main.bounds) let viewController =

UIWindow not showing over content in iOS 13

自闭症网瘾萝莉.ら 提交于 2019-12-02 19:36:51
I am upgrading my app to use the new UIScene patterns as defined in iOS 13, however a critical part of the app has stopped working. I have been using a UIWindow to cover the current content on the screen and present new information to the user, but in the current beta I am working with (iOS + XCode beta 3) the window will appear, but then disappear straight away. Here is the code I was using, that now does not work: let window = UIWindow(frame: UIScreen.main.bounds) let viewController = UIViewController() viewController.view.backgroundColor = .clear window.rootViewController = viewController

App crash on iPad simulator

感情迁移 提交于 2019-12-02 10:37:25
App works fine on iPhone device, iPhone simulator but when tested on iPad simulator it crashed and message got is [UIWindowLayer convertPoint:fromView:]: unrecognized selector sent to instance. Program received signal EXC_BAD_ACCESS on thread1 UIApplicationMain - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]autorelease]; self.containerViewController = [[[ContainerViewController alloc]init]autorelease]; self.window.rootViewController = self

“Application windows are expected to have a root view controller” conditional appearance

笑着哭i 提交于 2019-12-02 04:51:17
I'm writing an app for iPhone using Xcode 4.5 and iOS6. I'm also creating a new UIWindow to be able to manage the area of the status bar (to display messages there, etc.) I'm using storyboards and my appDelegate method looks like this: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { return YES; } The message does not appear in the console when I put it in the method called viewDidAppear : - (void)viewDidAppear:(BOOL)animated { if (!window) { window = [[SGStatusBar alloc] initWithFrame:CGRectZero]; window.frame = [[UIApplication

How do I detect touches on UIStatusBar/iPhone

你离开我真会死。 提交于 2019-12-02 04:23:25
问题 I'm trying to detect any touch on the iPhone's UIStatusBar but its not working. I've tried subclassing UIApplication and UIWindow to access it but still nothing. 回答1: Based on Tom's answer, I wrote the code. It works well. - (void)viewDidLoad { [super viewDidLoad]; // required UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectZero]; scrollView.delegate = self; scrollView.contentSize = CGSizeMake(0.0f,1.0f); [scrollView setContentOffset:CGPointMake(0.0f,1.0f) animated:NO]; /