- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 iOS 编程新手。我正在学习如何在 iOS 中使用模式。我有一个按钮。内部按钮点击处理程序。我想显示一个 UIViewController,如模态窗体。
这是我的代码:
@IBAction func userEditClick(sender: AnyObject) {
let userCtrl = UserEditViewController(nibName: "UserEditViewController", bundle: nil)
userCtrl.callback = self
userCtrl.modalPresentationStyle = UIModalPresentationStyle.FormSheet
//userCtrl.preferredContentSize = CGSizeMake(400, 800);
self.presentViewController(userCtrl, animated: true, completion: nil)
}
显示了 UserEditViewController 但屏幕看起来像普通的 UIViewController -> 这不是我所期望的 ---> Form Modal
谢谢!
最佳答案
您只需调用 presentViewController。这样就可以了。 presentViewController 的默认动画是模态的。此外,当您看到文档时,它说该设置将适应环境。所以我认为当您使用 iPhone 时,FormSheet 必须覆盖整个屏幕。我想你可能会坚持苹果的默认行为。
In a horizontally regular environment, a presentation style that displays the content centered in the screen. The width and height of the content area are smaller than the screen size and a dimming view is placed underneath the content. If the device is in a landscape orientation and the keyboard is visible, the position of the view is adjusted upward so that the view remains visible. All uncovered areas are dimmed to prevent the user from interacting with them.
In a horizontally compact environment, this option behaves the same as UIModalPresentationFullScreen.
Available in iOS 3.2 and later.
好吧,如果你想在 iPhone 或 iPad 上显示类似的表单,你需要计算大小并用你制作的动画显示它们并将它加载到你的 View Controller 上。
或者您可以查看此存储库 https://github.com/m1entus/MZFormSheetController他们做了困难的部分:)
关于ios - 呈现的模态视图 Controller 未像表单一样显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32597644/
我来自 Asp.Net 世界,试图理解 Angular State 的含义。 什么是 Angular 状态?它类似于Asp.Net中的ascx组件吗?是子页面吗?它类似于工作流程状态吗? 我听到很多人
我一直在寻找 3 态拨动开关,但运气不佳。 基本上我需要一个具有以下状态的开关: |开 |不适用 |关 | slider 默认从中间开始,一旦用户向左或向右滑动,就无法回到N/A(未回答)状态。 有人
我是一名优秀的程序员,十分优秀!