简体   繁体   English

如何将UIView一直放在顶部屏幕上?

[英]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. 我将在调试模式程序中显示带有来自NSLog的所有消息的UITextView。 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? 那么,我怎样才能让我的视图在我的程序中显示所有时间,看起来像状态栏?

In your didFinishLaunchingWithOptions 在你的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];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM