• 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: How to constrain a UISlider in a UIToolbar?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to constrain a UISlider in a UIToolbar?
      • From: "Gerriet M. Denkmann" <email@hidden>
References: 
 >How to constrain a UISlider in a UIToolbar? (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: iOS 8 beta 4 messes with my TextView
  • Next by Date: Re: iOS 8 beta 4 messes with my TextView
  • Previous by thread: How to constrain a UISlider in a UIToolbar?
  • Next by thread: Re: How to constrain a UISlider in a UIToolbar?
  • Index(es):
    • Date
    • Thread