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: "Gerriet M. Denkmann" <email@hidden>
- Date: Wed, 30 Jul 2014 13:30:41 +0700
On 30 Jul 2014, at 11:27, Kyle Sluder <email@hidden> wrote:
>> On Jul 29, 2014, at 9:11 PM, "Gerriet M. Denkmann" <email@hidden> wrote:
>>
>>
>> But nobody ever cares to call sizeThatFits or systemLayoutSizeFittingSize.
>>
>> Overriding requiresConstraintBasedLayout and returning either YES or NO makes no difference.
>>
>> Anything else I forgot to override?
>
> 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.
Anyway, this:
override func viewDidLoad()
{
let b = bottomToolBar.frame.size.width
speedSlider.frame.size.width = b - 8
super.viewDidLoad()
}
kind of works.
In Landscape the slider could be bigger though.
Maybe I could register for UIDeviceOrientationDidChangeNotifications and then do the same thing again.
Kind regards,
Gerriet.
_______________________________________________
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