The convertRect and convertPoint routines are essential here. Do your math in the most convenient space for you, then use some built in utility routines to convert it to coordinates within the space you are interested in.
I modified my placement of the display of a text to select buttons from:
[self.displayArea addSubview:choiceView];
to:
CGRect newFrame=[self.view convertRect:currentProblemDisplay.view.frame fromView:self.displayArea ];
currentProblemDisplay.view.frame=newFrame;
[self.view addSubview:currentProblemDisplay.view];
This way the view is displayed in the same location, but regardless of if it is in the bounds of the variable displayArea, it will still respond to inputs.
No comments:
Post a Comment