• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: UIStackView: Variable Spacing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UIStackView: Variable Spacing


  • Subject: Re: UIStackView: Variable Spacing
  • From: Daniel Stenmark <email@hidden>
  • Date: Wed, 06 Jul 2016 23:56:05 +0000
  • Thread-topic: UIStackView: Variable Spacing

It’s not so much that adding a single dummy view wrecks us.  Our cell layout has a lot going on, with a fair amount of variable spacing and multiple views often being hidden and swapped out.  The UIStackView scrolling performance slog I’m seeing is just sum of all that.

Sigh, oh well.  I guess that’s just another refactoring branch I’ll have to shelve for now.

Dan

> On Jul 6, 2016, at 4:45 PM, Roland King <email@hidden> wrote:
>
>
>> On 7 Jul 2016, at 04:37, Daniel Stenmark <email@hidden> wrote:
>>
>> What’s the best way to achieve variable spacing between children of a UIStackView?  I know that a popular approach is to add an empty dummy view to act as padding, but this is being used in a UITableView cell, so scrolling performance is critical and the implicit constraints created by adding a ‘padding’ view are a death knell for us.
>>
>> Dan
>
>
> There’s no trick way to do it, you need some extra view one way or another.
>
> It’s a bit surprising that adding extra, fixed sized children to the stack really adds that much overhead, that’s a few very simple constraints, all constant, and shouldn’t really make that much difference. Perhaps the stackview is being inefficient with the number of constraints it adds when you add an extra child. You could take a look at the view hierarchy and see if that’s the case or not.
>
> You could try going the other way around and making your real elements children of dummy views so you get to add the simplest top/bottom-padding constraints possible to those views, that may minimise the number of extra constraints added and you get to control it somewhat. But if your hierarchy is such that it’s straining the constraint system performance wise, whatever way you try to do this is going to have similar performance.


_______________________________________________

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


  • Follow-Ups:
    • Re: UIStackView: Variable Spacing
      • From: Fritz Anderson <email@hidden>
References: 
 >UIStackView: Variable Spacing (From: Daniel Stenmark <email@hidden>)
 >Re: UIStackView: Variable Spacing (From: Roland King <email@hidden>)

  • Prev by Date: Re: UIStackView: Variable Spacing
  • Next by Date: Re: UIStackView: Variable Spacing
  • Previous by thread: Re: UIStackView: Variable Spacing
  • Next by thread: Re: UIStackView: Variable Spacing
  • Index(es):
    • Date
    • Thread