Mobile Development 10.11 | webMethods Mobile SuiteWeb Help | webMethods Mobile Designer Native User Interface Reference | Native User Interface (NativeUI) Objects | nUINavbuttonElement
 
nUINavbuttonElement
com.softwareag.mobile.runtime.nui.nUINavbuttonElement
Use to display a button within a nUIViewDisplay object or a nUINavView object.
Usage Notes
*To use the nUINavbuttonElement object as a Back button, set the nUINavbuttonElement object’s Type attribute to nUINavbuttonElement.TYPE_BACK.
Note:
Do not use the nUINavbuttonElement object as a Back button in a nUINavView.
*When using the nUINavbuttonElement object as a Back button in a nUIViewDisplay object, you do not need to define an icon to use for the nUINavbuttonElement object.
When a user presses a physical Back button or touches a Back area on a touch screen, the nUINavbuttonElement object reacts to the user interaction.
*When using the nUINavbuttonElement object as a button in a nUINavView object, define the Text and Icon attributes for the button.
*When specifying an image with the Icon attribute, the file must be a PNG file. For information about using graphics in a mobile application, see Preparing Graphics for Your Mobile Application and Icon Creation and Usage for webMethods Mobile Designer.
*The following are platform-specific considerations:
Android
*The nUINavbuttonElement object is a android.view.MenuItem class. For more information, see http://developer.android.com/guide/topics/ui/menus.html.
*When you use the nUINavbuttonElement object in a nUINavView object, at least the Text or the Icon attributes must be supplied.
*When you use the nUINavbuttonElement object in a nUIViewDisplay object:
*The button displays in the header bar. This support is only available if android.nativeui.view.header.version is set to the newer style header bar introduced with Ice Cream Sandwich.
*If you set the Type attribute to nUINavbuttonElement.TYPE_BACK, and if the Android device has a physical Back button, the Back button is used. Otherwise, if the newer style header bar introduced with Ice Cream Sandwich is in use, Android draws a Back button in the header.
*If you use the HeaderText attribute, and there is no space available for both the header text and the nUINavbuttonElement objects, the header text is truncated.
*It is recommended that you insert no more than three nUINavbuttonElement objects in a nUIViewDisplay object.
*The Icon attribute is required. The icon will be used if it is supplied. If not, the Text attribute is used instead. Provide a brief text for the attribute as the text will be cropped at a width 1.5 times the width of the standard icon width.
*The size of the image you specify with the Icon attribute for a pop-up menu is based on the density of the screen of the device:
*Low density (ldpi) images is 36x36 pixels.
*Medium density (mdpi) images is 48x48 pixels.
*High density (hdpi) images is 72x72 pixels.
Note:
Extra high density (xdpi) is not applicable.
*The size of the image you specify with the Icon attribute for an action bar is based on the density of the screen of the device:
*Medium density (mdpi) images is 32x32 pixels.
*High density (hdpi) images is 48x48 pixels.
*Extra high density (xdpi) images is 64x64 pixels.
Note:
Low density (ldpi) is not applicable.
iOS
*The nUINavbuttonElement object is a UITabBarItem class.
*When you use the nUINavbuttonElement object in a nUINavView object:
*The Text and Icon attributes are required.
*When specifying an image with the Icon attribute, the image should be 32x32 pixels for a non-retina display or 64x64 pixels for a retina display. Additionally, the image should be black or transparent. The iOS device automatically adds highlighting and gradients at run time.
*When you use the nUINavbuttonElement object in a nUIViewDisplay object:
*The button displays in the header bar.
*If you set the Type attribute to nUINavbuttonElement.TYPE_BACK, the button displays in the left part of the header.
*The Icon or Text attribute is required. If you specify both, Icon is used.
*If you specify only the Text attribute, the iOS devices draws the text inside a button.
*When specifying an image with the Icon attribute, it is recommended that the image be 24x24 pixels for a non-retina display or 48x48 pixels for a retina display. The iOS device draws the icon without additional borders.
*If you use the HeaderText attribute and space is not available for both the header text and the nUINavbuttonElement objects, the header text is truncated.
*For an iPhone running on iOS, it is recommended that you insert no more than three nUINavbuttonElement objects in a nUIViewDisplay object.
*For an iPad running on iOS, it is recommended that you insert no more than six nUINavbuttonElement objects in a nUIViewDisplay object.