Re: How to constrain a UISlider in a UIToolbar?
Re: How to constrain a UISlider in a UIToolbar?
- Subject: Re: How to constrain a UISlider in a UIToolbar?
- From: Roland King <email@hidden>
- Date: Wed, 30 Jul 2014 22:44:48 +0800
> On 30 Jul 2014, at 2:30 pm, Gerriet M. Denkmann <email@hidden> wrote:
>
>
>>>
>>
>> Hmm, I'm pretty sure that’s all we override. Have you tried dropping our document title view into the toolbar and seeing what happens?
>
> No, I did not. It depends on OFBindingPoint et al., which might depend on other things, etc., etc.
> But I studied it diligently.
>
> The problem (I guess) is that UIToolbar does not use LayoutConstraints at all. And it probably simply does not expect any of it's UIBarButtonItems to change their size.
>
I think it’s because even though UIToolbar is a UIView subclass, UIButtonBarItem, which goes on it, isn’t. I never really understood why that was, it has that ‘NSCell’ code smell about it, feels like something done for efficient button bars in iOS 2.0 we’ll all suffer for forever. I assume that you kept the width of the button bar item which contains your custom view at the default of 0.0 right? It claims in that instance that the item sets the width to fit but I suspect that really only works if the content is a fixed icon and not a UIView.
Can you pin a view over the top of the toolbar using constraints (they are both sibling UIViews after all) then pin your slider in there?
_______________________________________________
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