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: Kyle Sluder <email@hidden>
- Date: Tue, 29 Jul 2014 08:14:11 -0700
> On Jul 29, 2014, at 2:34 AM, "Gerriet M. Denkmann" <email@hidden> wrote:
>
> I have a UIToolbar which contains a UISlider, flanked by two flexible spaces.
> I would like to have this slider to be as big as possible.
> Setting it's width does not make sense, as the UIToolbar width changes, depending on device and orientation.
>
> And setting constraints on the slider seems to be impossible (Xcode 6 beta 4).
>
> Any ideas?
You need to put your slider inside of a subclass of UIView whose implementation of -sizeThatFits: returns an appropriate value.
In our document-based iPad apps, we use this technique to put a “Sync” button adjacent to the document title.
Here’s the source code to our implementation: https://github.com/omnigroup/OmniGroup/blob/master/Frameworks/OmniUI/iPad-Document/OUIDocumentTitleView.m
--Kyle Sluder
_______________________________________________
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