2016-10-07 6 views
0

移行後、実行中のアプリケーションにボタンデザインと画像コンテンツが表示されません。それは次のようになります。私のカスタムセグエのためMacアプリケーション:コントローラを表示した後にボタンフレームと画像が表示されない

View in Xcode and in the app

コードは次のようである:

override func perform() { 

    // build from-to and parent-child view controller relationships 
    let sourceViewController = self.sourceController as! NSViewController 
    let destinationViewController = self.destinationController as! NSViewController 
    let containerViewController = sourceViewController.parent! as NSViewController 

    // add destinationViewController as child 
    containerViewController.insertChildViewController(destinationViewController, at: 1) 

    //perform transition 
    containerViewController.transition(from: sourceViewController, to: destinationViewController, options: NSViewControllerTransitionOptions.slideLeft, completionHandler: nil) 

    // lose the sourceViewController, it's no longer visible 
    containerViewController.removeChildViewController(at: 0) 
} 

答えて

0

これは単なる推測です。しかし、それはあなたのウィンドウが視覚効果ビュー/ウィンドウコンボであるように見えます。どちらが良いですか。しかし、私は、すべてのサブビューが "活気のある"外観を採用することがデフォルトの動作だと思う。特定の効果を出すために画像のアルファチャンネルを使用しようとするので、画像で奇妙な振る舞いをすることができます。画像ビューまたは親ビューの "allowsVibrancy"プロパティをNOに設定しようとしましたか?

+0

プロパティに割り当てることはできません: 'allowsVibrancy'はget-onlyプロパティです。 – Jublo

+0

あなたはそうです、それはNSVisualEffectViewですが、そのようなビューに画像を追加するにはどうすればよいのでしょうか?また、私がそれらをホバーするまで(なぜなら、私は再描画を引き起こすまで)ボタンが描かれないのはなぜですか? – Jublo

関連する問題