You are reading 12.6.0. See this page in 13.4.1.
Titanium.UI.iOS.MenuPopup
Extends Titanium.Proxy
A menu popup provides the ability to create custom tooltip options using the items property
covering the native UIMenuController class.
See also:
Examples
Example using multiple `items` and a `click` event.
The example below creates a new menu popup and shows it when the user clicks on the button.
var win = Ti.UI.createWindow({
backgroundColor: "#fff",
});
var button = Ti.UI.createButton({
title: "Show options"
});
win.add(button);
var menu = Ti.UI.iOS.createMenuPopup({
items: ["Option 1", "Option 2"]
});
menu.addEventListener("click", function(e) {
alert(e);
});
button.addEventListener("click", function() {
menu.show({
view: button
});
});
win.open();
Properties 3
Inherited from Titanium.Proxy
The name of the API that this proxy corresponds to.
Inherited from Titanium.Proxy
Indicates if the proxy will bubble an event to its parent.
Default: true
items
Array<String>The items of the menu popup.
The items will be shown as soon in the menu popup when the show method is called.
To hide them again, use the hide method in conjunction.
Methods 7
Inherited from Titanium.Proxy
Adds the specified callback as an event listener for the named event.
| Parameters | Type | Description |
|---|---|---|
| name | String | Name of the event. |
| callback | Callback<Titanium.Event> | Callback function to invoke when the event is fired. 4 fields
|
applyProperties
since 3.0.0Inherited from Titanium.Proxy
Applies the properties to the proxy.
| Parameters | Type | Description |
|---|---|---|
| props | Dictionary | A dictionary of properties to apply. |
Inherited from Titanium.Proxy
Fires a synthesized event to any registered listeners.
| Parameters | Type | Description |
|---|---|---|
| name | String | Name of the event. |
| event? | Dictionary | A dictionary of keys and values to add to the Titanium.Event object sent to the listeners. |
Hides the menu popup.
| Parameters | Type | Description |
|---|---|---|
| options? | AnimatedOptions | Includes options how the menu popup should be hidden. Introduced in SDK 5.2.0. Note that the default here is equivalent to passing in |
Indicates whether the menu popup is currently visible.
Inherited from Titanium.Proxy
Removes the specified callback as an event listener for the named event.
| Parameters | Type | Description |
|---|---|---|
| name | String | Name of the event. |
| callback | Callback<Titanium.Event> | Callback function to remove. Must be the same function passed to 4 fields
|
Shows the menu popup.
| Parameters | Type | Description |
|---|---|---|
| options | MenuPopupShowParams | Includes options how the menu popup should be shown. Note that the default is to be animated. 3 fields
|
Events 1
Fired when the user clicks at one of the menu popup items.
This event provides the properties title and index which relate to the name and position
of the clicked item inside the items property.
| Event properties | Type | Description |
|---|---|---|
| index | Number | The index of the clicked item. |
| title | String | The title of the clicked item. |