# Titanium.UI.iOS.Stepper

> A widget used to increment and decrement a value.

- Source: https://titaniumsdk.com/docs/sdk/12.6.2/Titanium.UI.iOS.Stepper
- Titanium SDK version: 12.6.2
- Kind: view
- Platforms: iPhone, iPad, macOS
- Since: Titanium SDK iPhone 5.4.0, iPad 5.4.0, macOS 9.2.0
- Extends: Titanium.UI.View
- Inheritance: Titanium.UI.View > Titanium.Proxy

| Default | Custom |
| ------- | ------ |
| ![Stepper](./stepper.png) | ![Custom](./stepper_custom.png) |

A Stepper displays its selected state while it is being pressed.
You can specify background images for each state on iOS.
Use the [Titanium.UI.iOS.createStepper](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.md#createStepper) method or a **`<Stepper>`** Alloy element to create a stepper
(see the "Examples" section details).

* When assigning a custom image to the `backgroundImage` property, the image must be
partially or wholly transparent for the background color or background gradient to be visible.
* Similarly, for an assigned background gradient to show through, the `backgroundColor` may need to be
set to 'transparent'.

* Note that the stepper cannot be re-sized.

## Example: Simple Stepper Example

``` js
var win = Ti.UI.createWindow({
    backgroundColor: '#fff'
});

var stepper = Ti.UI.iOS.createStepper({
    tintColor: "green",
    steps: 3,
    maximum: 30,
    minimum: 0
});

stepper.addEventListener("change", function(e) {
    Ti.API.info(e.value);
});

win.add(stepper);
win.open();
```

## Example: Alloy XML Markup

Previous example as an Alloy view.

stepper.xml:
``` xml
<Alloy>
    <Window id="window">
        <Stepper id="stepper" onClick="doClick" tintColor="green" steps="3" />
    </Window>
</Alloy>
```

stepper.js:
``` js
function doClick(e) {
    alert(e.value);
}

$.window.open();
```

## Properties

### autorepeat

- Type: Boolean
- Platforms: iPhone, iPad, macOS

If YES, the user pressing and holding on the stepper repeatedly alters value.
The default value is YES.

### backgroundImage

- Type: String
- Platforms: iPhone, iPad, macOS

Background image for the stepper in its normal state, specified as a local file path or URL.

Also sets the background image for other stepper states (focused, selected),
unless they've been specified explicitly. On iOS, if backgroundDisabledImage is unset, the
image will appear faded to indicate being disabled. Also on iOS, if backgroundSelectedImage
is unset, the image will be darkened to indicate being selected.

### continuous

- Type: Boolean
- Platforms: iPhone, iPad, macOS

If YES, value change events are sent immediately when the value changes during user interaction.
If NO, a value change event is sent when user interaction ends.
The default value is YES.

### decrementDisabledImage

- Type: String
- Platforms: iPhone, iPad, macOS

Background image for the stepper decrement button in its disabled state, specified as a local
file path or URL. The decrement button enters a disabled state ones the value is equal to the
minimumValue , setting the enabled property to false will have no effect to decrement button state.

### decrementImage

- Type: String
- Platforms: iPhone, iPad, macOS

Background image for the stepper decrement button in its normal state, specified as a local
file path or URL.

Also sets the background image for the other stepper states (disabled, focused, selected),
unless they've been specified explicitly, except for iOS, which requires a backgroundImage.

### enabled

- Type: Boolean
- Platforms: iPhone, iPad, macOS

Determines if the stepper is enabled or disabled.

### incrementDisabledImage

- Type: String
- Platforms: iPhone, iPad, macOS

Background image for the stepper increment button in its disabled state, specified as a local
file path or URL.The increment button enters a disabled state ones the value is equal to the
maximumValue , setting the enabled property to false will have no effect to increment button state.

### incrementImage

- Type: String
- Platforms: iPhone, iPad, macOS

Background image for the stepper increment button in its normal state, specified as a local
file path or URL.

Also sets the background image for the other stepper states (disabled, focused, selected),
unless they've been specified explicitly, except for iOS, which requires a backgroundImage.

### maximum

- Type: Number
- Platforms: iPhone, iPad, macOS

The maximum value the stepper will be set to, the value must be greater than the minimum value.
If you attempt to set a value equal to or lower than minimum, the system will default the
value to 100.

### minimum

- Type: Number
- Platforms: iPhone, iPad, macOS

The minimum value the stepper will be set to, the value must be smaller than the maximum value.
If you attempt to set a value equal to or greater than maximum, the system will default the
value to 0.

### steps

- Type: Number
- Platforms: iPhone, iPad, macOS

The value the stepper will increment and decrement by, default value for this property is 1. When setting
a new value, it must be greater than 1.

### tintColor

- Type: String | Titanium.UI.Color
- Platforms: iPhone, iPad, macOS

Sets the color for the widget, any backgroundImages added will be set to the same color.

For information about color values, see the "Colors" section of [Titanium.UI](https://titaniumsdk.com/docs/sdk/Titanium.UI.md).

### value

- Type: Number
- Platforms: iPhone, iPad, macOS

The current value of the stepper.

### wraps

- Type: Boolean
- Platforms: iPhone, iPad, macOS

If YES, incrementing beyond [Titanium.UI.iOS.Stepper.maximum](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.Stepper.md#maximum) sets value to [Titanium.UI.iOS.Stepper.minimum](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.Stepper.md#minimum). likewise, decrementing below
[Titanium.UI.iOS.Stepper.minimum](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.Stepper.md#minimum) sets value to [Titanium.UI.iOS.Stepper.maximum](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.Stepper.md#maximum). If NO, the stepper does not increment beyond [Titanium.UI.iOS.Stepper.maximum](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.Stepper.md#maximum) nor
does it decrement below [Titanium.UI.iOS.Stepper.minimum](https://titaniumsdk.com/docs/sdk/Titanium.UI.iOS.Stepper.md#minimum) but rather holds at those values.
The default value is NO.

## Events

### change

- Platforms: iPhone, iPad, macOS

Fired every time the stepper value changes.

Event properties:

- `value` (Number): The current value of the stepper.
- `minimum` (Number): The minimum value of the stepper.
- `maximum` (Number): The maximum value of the stepper.

## Inherited members

61 members are inherited. Each is documented on the type that declares it.

- [Titanium.Proxy](https://titaniumsdk.com/docs/sdk/12.6.2/Titanium.Proxy.md): `addEventListener`, `apiName`, `applyProperties`, `bubbleParent`, `fireEvent`, `removeEventListener`
- [Titanium.UI.View](https://titaniumsdk.com/docs/sdk/12.6.2/Titanium.UI.View.md): `accessibilityHidden`, `accessibilityHint`, `accessibilityLabel`, `accessibilityValue`, `anchorPoint`, `animate`, `animatedCenter`, `backgroundColor`, `backgroundGradient`, `backgroundLeftCap`, `backgroundRepeat`, `backgroundTopCap`, `borderColor`, `borderRadius`, `borderWidth`, `bottom`, `center`, `clearMotionEffects`, `click`, `clipMode`, `convertPointToView`, `dblclick`, `getViewById`, `height`, `hide`, `horizontalMotionEffect`, `horizontalWrap`, `id`, `insertAt`, `layout`, `left`, `opacity`, `previewContext`, `pullBackgroundColor`, `rect`, `right`, `rotation`, `show`, `size`, `toImage`, `tooltip`, `top`, `touchEnabled`, `touchcancel`, `touchend`, `touchmove`, `touchstart`, `transform`, `verticalMotionEffect`, `viewShadowColor`, `viewShadowOffset`, `viewShadowRadius`, `visible`, `width`, `zIndex`

---

- This corpus documents Titanium SDK 13.4.1. Anything here that does not name a version describes 13.4.1.
- Titanium is maintained by TiDev. The Appcelerator toolchain is retired: there is no `appc` CLI, no Appcelerator Studio and no hosted build service. The supported CLI is `titanium` on npm, invoked as `ti`.

