UIViews in swift -


All,

I have an image and then I display it on the screen and then the image One function to blur and then I'll run another function to add a box to it. But it does not show stigma and box and it is due to the AdSense view and insertSubView - I think I can not actually put both stigma and box on the scene. If I want to get rid of the adobe, then it does not show blurry. I can help with my understanding of addSubView and InsertSubView (array)

Here's my code:

 < Code> class view controller: UIViewController {var box: UIView? Override func viewDidLoad () {super.viewDidLoad () // Setup an additional after loading the scene, especially with a nibb. BananaImage: UIImage = UIImage (name: "preach-backgound.png") on imageV: UIImageView = UIImageView (Image: bananaImage) imageV.frame = CGRectMake (0, 0, bananaImage.size.width, bananaImage.size. Height) imageV.center = self.view.center self.view.addSubview (imageV) blur () // addBox (CGRectMake (200, 300, 30, 30))} function addBox (location: CGRect) {newbox = UIView (Frame: Location) newBox.backgroundColor = UIColor.clearColor () self.view.insertSubview (newbox, atIndex: 1) box = newbox} func blur () {var blur = UIVisualEffectView (effect: UIBlurEffect (style: light)) As the UIVisualEffectView blur.frame = self.view.frame self.view.addSubview (stigma)}    

Part of the problem It is that you have no way of knowing whether addbox is doing anything or not here is your code:

  go to newBox = UIView (frame: Location) newBox.backgroundColor = UIColor.clearColor () self.view.insertSubview (newBox, atIndex: 1)   

A scene in which a clear background color is not completely invisible. So you can not see anything - which, Sherlock Holmes says, is what you can expect to see.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -