ios - Cannot determine when UIImageView frames are equal -
i have 2 layers. bottom layer consists of hidden uiimageview
s, upper layer consists of visible uiimageview
s. when frames of bottom layer uiimageview
s equal frames of upper layer uiimageview
s, have see in nslog
.
the problem boolean method called nstimer
returns true immediately, see nslog
. want see nslog
when corresponding frames equal each other.
this code:
- (void)checktheframes { bool allequals = [self isequalframes]; if (allequals) { nslog(@"all frames equal"); [allposcorrecttimer invalidate]; } } -(bool)isequalframes { for(int = 0; < arrayimg.count; i++ ){ uiimageview *imageview1 = arrayimg[i]; uiimageview *imageview2 = hiddenfieldview[i]; if (!cgrectequaltorect(imageview1.frame, imageview2.frame)) { return no; } } return yes; }
is there way solve issue?
i think whats wrong you're comparing xs , ys too... maybe should go further frame.size
, compare them. or maybe compare widths , heights (frame1.size.width == frame2.size.width)
let me know if didn't solve problem!
Comments
Post a Comment