Re: Bothersome "NSView-Encapsulated-Layout-Height" constraint?
site_archiver@lists.apple.com Delivered-To: cocoa-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1535675740; bh=svw2MElCe55xqxM/GYgxba13yoOTv1ZsYOpWfUN6RLo=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=c9qswJWcWmiBC+Nec3P8VxPjqT64OsHKequ9YMLfjjvriMgDfnRBISiBa69s8+TNN lHEFv/FkjvEiZ0W5TiVPSWDra6i1lCw9g6IHKPjZp+zI1rLKU37C3T1MomXROvtQ49 gtzYr3R8XcFKKa3cSzSiEcoktNzyiCWK6Ox3sGfg82aEfrcRlFxmnT7MGZqWGwAADf KoKtj5z3uuBSkEfuK5eIwkZZ05tzVh70kBhI+ZL6ulGlTwWpmH9knHxAWCVzddYh/h trrFDt1aVQ7zIGL7IffB5Tq9MPnzj3UO8UVNbe8appNf8uaEvCurOAeUaahpuGkwvs HRmMug5l3HaWw== You need to implement -outlineView:heightOfRowByItem: to return the height you want for each row. Hope that helps. —Rob
On Aug 30, 2018, at 6:23 PM, Demitri Muna <cocoa-dev@demitri.com> wrote:
Hi,
I’ve been hitting my head against a wall for more time than I’d like to admit on what should be a simple problem - maybe someone can spot it immediately…
I’m implementing a view-based source list style NSOutlineView (I’m trying to mimic the Finder sidebar). My header items are a different row height than the items underneath. I’ve implemented outlineView:rowViewForItem: (returns 24 for headers, 20 for items).
The rows are spaced as expected in the column, but they are not drawn correctly. The cell is cropped to 12 pixels, as seen here:
I expect the highlighting to extend to the full height of the row. I tried to force this by adding two constraints, 2 pixels above and below the image, then got this:
2018-08-30 14:55:36.807612-0400 Nightlight[78272:15775715] [Layout] Unable to simultaneously satisfy constraints: ( "<NSLayoutConstraint:0x60c00009be90 NSImageView:0x60c000170e00.height == 16 (active)>", "<NSLayoutConstraint:0x60c000087ee0 V:|-(2)-[NSImageView:0x60c000170e00] (active, names: DE_DataCell:0x60c000188470, '|':DE_DataCell:0x60c000188470 )>", "<NSLayoutConstraint:0x60c000082300 V:[NSImageView:0x60c000170e00]-(2)-| (active, names: DE_DataCell:0x60c000188470, '|':DE_DataCell:0x60c000188470 )>", "<NSLayoutConstraint:0x60c00009c5c0 'NSView-Encapsulated-Layout-Height' DE_DataCell.height == 12 (active, names: DE_DataCell:0x60c000188470 )>" )
This shows where the problem is: a height constraint on the row of 12 with the name "NSView-Encapsulated-Layout-Height”. This is the exact height I see being drawn. I have no idea where this is coming from or how to fix it though. Any help welcome - it’s annoying because this seems like such simple thing!
Demitri _______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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: https://lists.apple.com/mailman/options/cocoa-dev/petrock%40mac.com
This email sent to petrock@mac.com
_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Rob Petrovec