Search code examples
iphoneiosuiviewuiwindow

How to put a UIView all time on top screen?


I will show a UITextView with all messages from the NSLog in my debug mode program. It work, but my problem is: I have to show it all times. So, how can I make my view to be showing all time in my program, look like the Status Bar?


Solution

  • In your didFinishLaunchingWithOptions

    set the following

    //Add the textView to the rootviewcontroller view
    UITextView *textView = [[UITextView alloc] init];
    textView.frame = CGRectMake(0, 20, 320, 40);
    [self.window.rootViewController.view addSubview:textView];