- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试将 UIToolbar 放置在 UIPopoverController 的顶部,就像 Apple 在页面和主题演讲中使用“媒体”、“表格”、“图表”、“形状”工具栏所做的一样。
我已经设法使用与 this post 中描述的相同方法将一个放在底部但我无法将其移至顶部。
我可以通过在其中一个 subview Controller 中放置一个普通的 UIToolbar 来做到这一点,但是工具栏似乎与边框不在同一条线上,而且看起来不像在苹果应用程序中那样漂亮。
有没有人对如何执行此操作有任何建议,或者是否可能?任何帮助将不胜感激。
谢谢!
最佳答案
使用一个 UINavigationController,它只包含一个 ViewController 作为 popoverController 的内容,像这样:
MyViewController *myVC = [[myViewController alloc] init];
UINavigationController *navCon = [[UINavigationController alloc] initWithRootViewController:myVC];
myPopoverController = [[UIPopoverController alloc] initWithContentViewController:navCon];
[myVC release];
[navCon release];
[myPopoverController presentPopoverFromRect:rect
inView:view
permittedArrowDirections:UIPopoverArrowDirectionRight
animated:YES];
然后,在您的 viewController 的初始化中,设置 navigationController 的项目:
self.navigationItem.title = @"myTitle";
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemEdit target:self action:@selector(editButtonTapped:)] autorelease];
你可以疯狂地把你想要的任何东西放在那里:
self.navigationItem.titleView = [[MySpecialTitleView alloc] initWithFrame...];
如果堆栈上只有一个 ViewController,您的导航 Controller 将不会导航。
iOS 7 警告:弹出框内的 NavigationBars 似乎忽略了 iOS 7 中的色调。我认为这是一个错误,如果您遇到此问题,我鼓励您向 Apple 提交错误报告。
关于objective-c - 顶部的 UIPopoverController 工具栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6599918/
如上所述,在 iOS8 中,[UIPopoverController presentPopoverFromRect] 不再适用于 [UIApplication sharedApplication].k
我有一个 UISearchBar。当用户触摸 UISearchBar 时,会显示一个包含结果的 UITableView 的 UIPopoverController。当用户输入时,结果就会出现。 我希望
我正在尝试创建一个如上所示的弹出窗口。 它可以是一个按钮或只有一个项目的 TableViewController。 我查看了很多教程,但它们似乎都比必要的复杂得多。 有没有办法在不创建新的 ViewC
有谁知道是否可以在 iPad 上为 UIPopOverController 设置透明背景? 我想在弹出框内放置一个半透明 View (因此希望弹出框本身具有透明背景)。 我认为这是不可能的……但我很想
如何“执行选择器”到uipopovercontroller的parentviewcontroller? 我有从uiviewcontroller中解放出来的uipopovercontroller,这个u
希望有办法做到这一点。希望只显示 View 周围的边框,顶部没有 40px 标题栏。可能吗? 最佳答案 已回答...我正在使用导航 Controller 初始化它。一旦我删除了它,我就没有得到标题栏。
我有一个通用应用程序。在 iPad 上,当按下注释图钉时,它会显示标注气泡。当我按下关闭按钮时,它会加载一个带有详细 View 的 uipopovercontroller。我想知道的是如何加载 uip
我想知道如何制作一个没有箭头的 UIPopoverController事实上我想模拟这样的事情: 看看 没有箭头 有一个标题以某种方式位于 UIPopoverController 的扩展顶部边框内部,
我有一个显示表格的 UIPopoverController。我使用 PresentFromBarButtonItem 方法。 我怎样才能给弹出窗口显示一个标题,UISpliter 做了多少列表? 最佳
我有一个问题,this question 的回答最多。 . 但是,我的任务略有不同。我想将 UIImageViews 从 UIPopover Controller 拖放到另一个 UIView,但弹出框
我正在以这种方式创建一个弹出框: popoverController = [[UIPopoverController alloc]initWithContentViewController:brows
我有一个 UIPopoverController由 TableView 组成。这个弹出式 Controller 显示得很好,我已经设置了委托(delegate) didSelectRowAtIndex
是否可以从第一个弹出窗口 UIButton 单击打开另一个 uipopovercontroller?如果是,那我该怎么做? 现在我正在使用给定的代码从 UIBarButtonItem 打开一个弹出窗口
我正在窗口内切换 View 。方向有时会混淆。 在其中一个窗口中,当我尝试显示应附加到工具栏按钮的弹出窗口时,它显示在屏幕上的位置。如果我物理地改变设备的方向,弹出窗口会在正确的位置重绘。如果我再次切
iOS 9 中 PopoverController 的正确代码是什么?在任何地方都可以找到此代码的正确代码? @IBAction func share(发送者:UIBarButtonItem){
我有一个普通的 UIPopoverController,它是这样制作的: -(IBAction)btKBIs_click:(id)sender { if(kbiPopOver != NULL)
我有一个按钮,当按下它时会显示一个 View Controller ,这是一个通用应用程序。 在 iPhone 上, View Controller 被推送到导航堆栈上。在 iPad 上,它显示在弹出
在 iOS 7 中,UIPopoverControllers 具有视差效果(前景悬停在背景之上)。 这在处于纵向模式的 UISplitViewController 中尤其难看。 线条不在同一水平面上。
我知道 UIPopOverController 可以提供标准下拉菜单,但我很好奇它是否可以提供动态下拉菜单。 动态下拉菜单将更进一步,单击列表中的任何项目都可以展开更多选项或执行某些其他操作,类似于文
我发现在呈现 UIPopoverController 时,并非呈现 View 中的所有控件都被禁用。具体来说,导航栏按钮(例如“后退”)仍然可选。我认为这是一个缺陷 - 它允许弹出窗口保留在屏幕上,而
我是一名优秀的程序员,十分优秀!