https://github.com/hansemannn/titanium-tooltip
Use the native AMPopTip (iOS) and ViewTooltip (Android) library to display tooltips above any view and window in Titanium!
https://github.com/hansemannn/titanium-tooltip
javascript native tidev titanium tooltips
Last synced: 9 months ago
JSON representation
Use the native AMPopTip (iOS) and ViewTooltip (Android) library to display tooltips above any view and window in Titanium!
- Host: GitHub
- URL: https://github.com/hansemannn/titanium-tooltip
- Owner: hansemannn
- License: mit
- Created: 2019-12-08T13:50:05.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-29T14:16:19.000Z (about 3 years ago)
- Last Synced: 2025-03-29T01:12:02.022Z (10 months ago)
- Topics: javascript, native, tidev, titanium, tooltips
- Language: Objective-C
- Homepage:
- Size: 9.59 MB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tooltips in Titanium
Use the native `AMPopTip` (iOS) and `ViewTooltip` (Android) library to display tooltips above any view and window in Titanium!
## Requirements
- [x] Titanium SDK 9.2.0+
- [x] Android: Add the following to your `[app]/platform/android/build.gradle`:
```gradle
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
```
## APIs
### Methods
- `show(params)` - Shows a new tooltip. See the example below for all options!
- `hideActiveTooltip` - Hide an active tooltip in the current window.
### Constants
The following constants are used for the `direction` property:
- `TOOLTIP_DIRECTION_UP`
- `TOOLTIP_DIRECTION_DOWN`
- `TOOLTIP_DIRECTION_LEFT`
- `TOOLTIP_DIRECTION_RIGHT`
## Example
```js
import Tooltips from 'ti.tooltip';
const params = {
container: $.win,
sourceView: $.view,
direction: Tooltips.TOOLTIP_DIRECTION_UP,
title: 'Hello world',
backgroundColor: '#ffffff',
textColor: '#000000',
borderRadius: 15,
borderColor: '#ff0000',
borderWidth: 2,
padding: 10,
arrowMargin: 0,
arrowWidth: 20,
arrowHeight: 24,
onClick: () => {
alert('Tooltip tapped!');
}
};
Tooltips.show(params);
```
## Authors
- Prashant Saini (Android)
- Hans Knöchel (iOS)
## License
MIT