iOS 有一个“细节”:酒吧随时可用
我想随时在我的应用程序顶部查看有关工具栏大小的小视图。该视图仅可用于显示一些文本详细信息。我正在考虑将根视图控制器设置为导航控制器并将提示设置为我想要显示的内容,但这似乎有点hacky。有人对如何做到这一点有其他想法吗?
I would like to have a small view about the size of a toolbar available at the top of my app at anytime. This view would be available only for displaying some textual details. I was thinking of setting the root view controller to be a navigation controller and setting the prompt to be what I want to display, but this seems kind of hacky. Does anyone have any other ideas on how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的方法是将
UIView
添加到应用程序委托的UIWindow
中。例如,您可以转到application:didFinishLaunchingWithOptions:
和[self.window addSubview:overlay];
,其中overlay是以编程方式创建的UIView
或在IB中。The way I do it is to add a
UIView
to theUIWindow
of the application delegate. For example, you can go toapplication:didFinishLaunchingWithOptions:
and[self.window addSubview:overlay];
where overlay is aUIView
created programmatically or in IB.