Re: NSTableCellView Constraints?
Re: NSTableCellView Constraints?
- Subject: Re: NSTableCellView Constraints?
- From: Roland King <email@hidden>
- Date: Wed, 28 Jan 2015 07:34:40 +0800
> On 28 Jan 2015, at 01:50, Thomas Wetmore <email@hidden> wrote:
>
>
>> On Jan 27, 2015, at 12:06 PM, Steve Mills <email@hidden> wrote:
>>
>> On Jan 27, 2015, at 10:48:29, Roland King <email@hidden> wrote:
>>>
>>>>
>>>> Using IB to check the constraints on the NSTextField within the NSTableCellView, IB states: “The selected views have no constraints. At build time, explicit left, top, width, and height constraints will be generated for the view.” If this is true, then the constraints that are generated are preventing the text field from getting wider than the launch time width of the column.
>>>
>>> So there you go. Exactly as I said there are no constraints fixing the text field to the cell so it's getting a fixed width and height and position at runtime. So add some. Don't worry about the cell itself, the table view will sort that out, just constrain your text view to pin to the edges of the cell so it expands as the column does.
>
> Thanks. This worked for me also. I believe IB should set up these constraints by default, but that things are still in a state of flux.
>
No I don’t think so. I can’t think of a case IB adds constraints to anything automatically at this point. That was Xcode 4 where it attempted to guess what the user wanted and add and remove constraints to keep the layout unambiguous and fully constrained and it was pretty much unusable, shifting a view by 1px could destroy 20 minutes of work. Now you get the views you add and if you want to constrain them, you can and if you don’t you don’t. This all works much better than Xcode 4, or even 5 and although the constraint system still causes me some head-scratching moments, the tools and visualization of the constraints you’ve added, and the ability to select and edit them and see live what’s going on, is 1000x better than it was when autolayout first burst upon us.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden