开发者

Problem when changing between Subviews (iOS Developement)

开发者 https://www.devze.com 2023-02-07 00:23 出处:网络
I am developing for iOS for about 5 to 6 months now. Right now I am trying to implement a Face Detection Algorithm which marks faces on an UIImage which i take with help from the AVFoundation Framewor

I am developing for iOS for about 5 to 6 months now. Right now I am trying to implement a Face Detection Algorithm which marks faces on an UIImage which i take with help from the AVFoundation Framework.

Well, it all works (almost) fine. During the programming stages i had simple buttons with which i could do all the steps one at a time. Everything worked great.

Now i packed everything into one button click, but even after 2-3 minutes nothing showed up. I played around a little with NSLog outputs to mark the time when every step was completed and the Algorithm and everything was successful, but the View still would not change to show the Image which i packed into the UIImageView as a subview of the other View.

Funny thing is, when i get the NSLog Message i can click on the place on the screen where other buttons a开发者_运维技巧re (as i placed them in the Interface Builder) and those buttons actually react to my interaction though nothing is shown!?

I usually transit between UIViews by setting the alpha Value to 0.0 and 1.0. Then I tried to transit with [[viewController view] bringSubviewToFront:subview]; but that didn't help!

Anyone knows where the problem might be?

Best Regards!


It could be that your are making changes to views on a background thread. Try performing the changes on the main thread.


It could be that the z-ordering is not what you are expecting if you're switching between subviews. If you have a pointer to the UIView that isn't showing up, try using the exchangeSubviewAtIndex:withSubviewAtIndex: method of the parent view to make sure that the desired one is on top.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号