Closed JonasNielsen closed 10 years ago
A quick update:
In particular I was having problems with views inside NSTabView
. I wasn't aware that views inside NSTabView uses a flipped coordinate system (logical, right..).
The documentation says that it's possible to override isFlipped
for any view to flip the coordinate system. This could probably be useful for many views. I'll give it a try.
Any update on this one? Is this an issue with Teacup, or can this issue be closed?
Honestly, I don't know. I ended up hard-coding the dimensions and positions of most of my views. Thankfully this wasn't an issue for the kind of interface I needed. Feel free to close the issue.
K, if it comes up again, please submit a project that reproduces the issue and file another report. Thanks!
Hi guys
I'm struggling to position my views correctly with teacup 2.1.2 (OSX app). I understand that the coordinate system is inverted compared to iOS. Still I have a suspicion that some of the helper and layout methods are not working as expected.
My strategy so forth has been to place views with
frame:
and beg that OSX would arrange them nicely using springs and struts -autoresizingMask:
. If I only useframe:
, views are placed in correct coordinates. Using autoresizingMask appears to have no or random results.This is frustrating, because it's often basic problems: How do you pin a bar to the top of a window? I would expect the following to work:
But it doesn't, the view is at the bottom. Increasing the
top:
value moves the view upwards in the coordinate system.For some views, I've had moderate success with
constraints
, however at some point the layout breaks and it's difficult to debug why.What is the best layout technique for OSX? And how much of Frame calculations, Auto layout and Autoresizing mask is supported?
Excuse me for the broad question, it's hard to be more concrete without loads of examples.
My conclusion has been that it is possible to position views only using
frame:
, but it's extremely cumbersome to calculate everything from the bottom of a window and the result is not very dynamic.