Class: UIToolbar

Inherits:
UIView show all

Overview

A toolbar is a control that displays one or more buttons, called toolbar items. A toolbar momentarily highlights or does not change the appearance of an item when tapped.

Instance Attribute Summary (collapse)

Attributes inherited from UIView

#alpha, #autoresizesSubviews, #autoresizingMask, #backgroundColor, #bounds, #center, #clearsContextBeforeDrawing, #clipsToBounds, #contentMode, #contentScaleFactor, #exclusiveTouch, #frame, #gestureRecognizers, #hidden, #layer, #multipleTouchEnabled, #opaque, #restorationIdentifier, #subviews, #superview, #tag, #transform, #userInteractionEnabled, #window

Attributes inherited from UIResponder

#inputAccessoryView, #inputView, #undoManager

Instance Method Summary (collapse)

Methods inherited from UIView

#addConstraint:, #addConstraints:, #addGestureRecognizer:, #addSubview:, #alignmentRectForFrame:, #alignmentRectInsets, animateWithDuration:animations:, animateWithDuration:animations:completion:, animateWithDuration:delay:options:animations:completion:, areAnimationsEnabled, beginAnimations:context:, #bringSubviewToFront:, commitAnimations, #constraints, #constraintsAffectingLayoutForAxis:, #contentCompressionResistancePriorityForAxis:, #contentHuggingPriorityForAxis:, #convertPoint:fromView:, #convertPoint:toView:, #convertRect:fromView:, #convertRect:toView:, #decodeRestorableStateWithCoder:, #didAddSubview:, #didMoveToSuperview, #didMoveToWindow, #drawRect:, #drawRect:forViewPrintFormatter:, #encodeRestorableStateWithCoder:, #endEditing:, #exchangeSubviewAtIndex:withSubviewAtIndex:, #exerciseAmbiguityInLayout, #frameForAlignmentRect:, #gestureRecognizerShouldBegin:, #hasAmbiguousLayout, #hitTest:withEvent:, #initWithFrame:, #insertSubview:aboveSubview:, #insertSubview:atIndex:, #insertSubview:belowSubview:, #intrinsicContentSize, #invalidateIntrinsicContentSize, #isDescendantOfView:, layerClass, #layoutIfNeeded, #layoutSubviews, #needsUpdateConstraints, #pointInside:withEvent:, #removeConstraint:, #removeConstraints:, #removeFromSuperview, #removeGestureRecognizer:, requiresConstraintBasedLayout, #sendSubviewToBack:, setAnimationBeginsFromCurrentState:, setAnimationCurve:, setAnimationDelay:, setAnimationDelegate:, setAnimationDidStopSelector:, setAnimationDuration:, setAnimationRepeatAutoreverses:, setAnimationRepeatCount:, setAnimationStartDate:, setAnimationTransition:forView:cache:, setAnimationWillStartSelector:, setAnimationsEnabled:, #setContentCompressionResistancePriority:forAxis:, #setContentHuggingPriority:forAxis:, #setNeedsDisplay, #setNeedsDisplayInRect:, #setNeedsLayout, #setNeedsUpdateConstraints, #setTranslatesAutoresizingMaskIntoConstraints:, #sizeThatFits:, #sizeToFit, #systemLayoutSizeFittingSize:, transitionFromView:toView:duration:options:completion:, transitionWithView:duration:options:animations:completion:, #translatesAutoresizingMaskIntoConstraints, #updateConstraints, #updateConstraintsIfNeeded, #viewForBaselineLayout, #viewPrintFormatter, #viewWithTag:, #willMoveToSuperview:, #willMoveToWindow:, #willRemoveSubview:

Methods inherited from UIResponder

#becomeFirstResponder, #canBecomeFirstResponder, #canPerformAction:withSender:, #canResignFirstResponder, #isFirstResponder, #motionBegan:withEvent:, #motionCancelled:withEvent:, #motionEnded:withEvent:, #nextResponder, #reloadInputViews, #remoteControlReceivedWithEvent:, #resignFirstResponder, #touchesBegan:withEvent:, #touchesCancelled:withEvent:, #touchesEnded:withEvent:, #touchesMoved:withEvent:

Methods inherited from NSObject

#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version

Constructor Details

This class inherits a constructor from NSObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NSObject

Instance Attribute Details

- (UIBarStyle) barStyle

The toolbar style that specifies its appearance. See UIBarStyle for possible values. The default value is UIBarStyleDefault.

Returns:

  • (UIBarStyle)

- (Array) items

The items displayed on the toolbar. The items, instances of UIBarButtonItem, that are visible on the toolbar in the order they appear in this array. Any changes to this property are not animated. Use the setItems:animated: method to animate changes.The default value is nil.

Returns:

- (UIColor) tintColor

The color used to tint the bar. The default value is nil.

Returns:

- (Boolean) translucent

A Boolean value that indicates whether the toolbar is translucent (YES) or not (NO). Applying translucence to a toolbar is intended primarily for landscape orientation, when you want the user to be able to view the area beneath the toolbar. The default value for this property is NO. However, if you set the toolbar style to UIBarStyleBlackTranslucent, the value for this property is always YES.

Returns:

  • (Boolean)

Instance Method Details

- (UIImage) backgroundImageForToolbarPosition(topOrBottom, barMetrics:barMetrics)

Returns the image to use for the background in a given position and with given metrics. The default value is nil. When non-nil the image will be used instead of the system image for toolbars in the specified position.

Parameters:

Returns:

  • (UIImage)

    The image to use for the toolbar background in the position specified by topOrBottom and with the metrics specified by barMetrics.

- (Object) setBackgroundImage(backgroundImage, forToolbarPosition:topOrBottom, barMetrics:barMetrics)

Sets the image to use for the background in a given position and with given metrics.

Parameters:

  • backgroundImage (UIImage)

    The image to use for the toolbar background in the position specified by topOrBottom and with the metrics specified by barMetrics.

  • topOrBottom (UIToolbarPosition)

    A toolbar position constant.

  • barMetrics (UIBarMetrics)

    A bar metrics constant.

Returns:

- (Object) setItems(items, animated:animated)

Sets the items on the toolbar by animating the changes. If animated is YES, the changes are dissolved or the reordering is animated—for example, removed items fade out and new items fade in. This method also adjusts the spacing between items.

Parameters:

  • items (Array)

    The items to display on the toolbar.

  • animated (Boolean)

    A Boolean value if set to YES animates the transition to the items; otherwise, does not.

Returns:

- (Object) setShadowImage(shadowImage, forToolbarPosition:topOrBottom)

Sets the image to use for the toolbar shadow in a given position. When the shadowImage parameter is nil, the default shadow will be used. When non-nil, the shadowImage property is a custom shadow image to show instead of the default. Using the topOrBottom parameter, you can set a different shadow for toolbars at the top and bottom of the view. For a custom shadow image to be shown, a custom background image must also be set with the setBackgroundImage:forToolbarPosition:barMetrics: method. If the default background image is used, then the default shadow image will be used regardless of the value of the shadowImage parameter.

Parameters:

  • shadowImage (UIImage)

    The image to use for the toolbar shadow in the position specified by topOrBottom.

  • topOrBottom (UIToolbarPosition)

    A toolbar position constant. You can use this parameter to indicate whether the shadowImage is intended for a toolbar at the top or bottom of the view.

Returns:

- (UIImage) shadowImageForToolbarPosition(topOrBottom)

Returns the image to use for the toolbar shadow in a given position. The default value is nil, which corresponds to the default shadow image being used. When non-nil, the return value represents the shadow that is used on the toolbar in the position specified by the topOrBottom parameter.

Parameters:

  • topOrBottom (UIToolbarPosition)

    A toolbar position constant. You can use this parameter to indicate whether the shadow image returned is intended for use in a toolbar at the top or bottom of the view.

Returns:

  • (UIImage)

    The image to use for the toolbar shadow in the position specified by topOrBottom.