English 中文(简体)
UI Modal Presentation 表格 具有透明背景的称呼?
原标题:UIModalPresentationFormSheet with transparent background?

基本上在此 我想格式表要透明,以便我能够看到该表背后的《国际统一意见》(完整筛选)。

这是可能的吗? 缩略语

我在从<条形码>ModalPresentationFormSheet转向另一种表述方式时,便注意到了我的看法。

我在哪里错了?

最佳回答

只要我能够说明这一点,就已是不可能的。 它过去是,但肥料却使这一功能丧失。

相反,我要做的是建立我的<条码>。 UIView与正常一样,在我的主要观点中增加。 我不得不放弃我的表格,然后做这一介绍。

问题回答

这为我工作:

[modalView.superview setBackgroundcolor:[UIColor clearColor]];

It ll still dim the background view transparently, but won t cover it with solid gray.

......

UPDATE FOR iOS 8

My previous solution no longer works for iOS 8. There are a lot of steps to get something like this to work for iOS 8. So I ve created a nice reusable solution: ModalController https://github.com/koreyhinton/ModalController.

它真正容易使用和自动传播。

let modal = ModalController()
modal.content = myCustomView
presentViewController(modal, animated: true, completion: nil)

如果你有兴趣了解执行情况细节,那么我是如何做到:

你们的模型控制员接受整个检查,主要观察背景将在清点和半航海之间总结。 之后,你将有一个内容观点,即以可靠的背景说明为核心的方式。 我也使用介绍方式:www.roc.OverCurrentCon texts /index.html。

var content = UIView()

override func viewDidLoad() {
    super.viewDidLoad()
    view.backgroundColor = UIColor.clearColor()
    content.frame = CGRect(x:0, y:0, width:300, height:300)
    content.backgroundColor = UIColor.blackColor()
    view.addSubview(content)
}

override func viewDidAppear(animated: Bool) {
    super.viewDidAppear(animated)
    view.backgroundColor = UIColor.blackColor().colorWithAlphaComponent(0.7)
}

override func viewWillDisappear(animated: Bool) {
    super.viewWillDisappear(animated)
    view.backgroundColor = UIColor.clearColor()
}

override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()

    content!.center = view.center
}




相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签