hi,
so here I go with another really noobish question:
What I wanted to do today is to slide in a view from the bottom of the screen. the view is a full-screen view, just like it's superview.
so, to simplify things, I tried just putting the view (let's call it view2) exactly over it's superview (view1). If I managed to do that it should be easy to get the view below the screen (by just adding it's height to the y-coordinate) and from there I can slide it back up.
putting the view exactly over the superview is where I got stucked.
first I tried something like this
UIView *view2 = [[UIView alloc] initWithFrame:view1.frame];
that, of course, didn't work because the coordinates of the top-left corner are based on the coordinate-system of the superview. however, I then tried this:
UIView *view2 = [[UIView alloc] init];
view2.frame = [view1 convertRect:view1.frame toView:view2];
I thought this has to work. I was surprised that it did not.
my question is: why did my second attempt not work? strangely, it does work when I add
view2.center = [view1 convertPoint:view1.center toView:view2];
but this does not help me as long as I don't understand WHY one works and the other doesn't.
would it be bad coding style to just convert everything to the coordinate system of the window itself? would make things a lot easier for me I guess.
what's the best attempt to do that? what's the best way to work with coordinates? how do I put a view below another? as you can see this is really basic stuff but I'm having a hard time with it
I really need some help seeing clearly with all this. thanks a lot :-)