IOS背景渐变 - 故事板

时间:2017-04-07 17:27:03

标签: ios swift3 xcode8

无论如何都要在故事板上显示背景渐变,而不是每次启动模拟器以查看它的样子

我已创建并扩展

    let background = CAGradientLayer().stopwatchColour()
    background.frame = self.view.bounds
    self.view.layer.insertSublayer(background, at: 0)

然后从我的控制器

<?php if (isset($_SESSION['currentfile'])) { ?>
$("#sourcepreviewout").click(function () {
window.open("<?php $dir = "template/" . trim(file_get_contents("admin/template.txt")) . "/result/";
echo $dir . $_SESSION['currentfile'];
?>", '_blank');
});
<?php } ?>
});

1 个答案:

答案 0 :(得分:0)

我建议在快速的游乐场中尝试代码。每次键入时,Swift Playground都会执行您的代码。您可以查看背景的外观并根据需要进行编辑。然后,您可以将代码粘贴到Xcode项目中,而无需运行模拟器。

祝你好运