An open API service indexing awesome lists of open source software.

https://github.com/nericode/nativescript-tooltip

NativeScript Tooltip - Android & iOS
https://github.com/nericode/nativescript-tooltip

Last synced: about 1 year ago
JSON representation

NativeScript Tooltip - Android & iOS

Awesome Lists containing this project

README

          

# Tooltip {NS} ![apple](https://cdn3.iconfinder.com/data/icons/picons-social/57/16-apple-32.png) ![android](https://cdn4.iconfinder.com/data/icons/logos-3/228/android-32.png)

## Installation

Ideally it would be something like:

```javascript
tns plugin add nativescript-tooltip-ns
```

## Screenshot

Android

## Usage

```ts
import { TooltipNs } from "nativescript-tooltip-ns";

var tooltip = new TooltipNs();
var button = this.page.getViewById("label");

tooltip.show({
message: "Hello! this is my tooltip...",
view: button,
ios: {
hasInterval: false,
shadow: true,
cornerRadius: 0,
margin: [0, 0, 0, 0],
padding: [0, 0, 0, 0],
color: "yellow",
textColor: "black", // Optional
},
android: {
position: "bottom",
style: "ToolTipLayoutCustomStyle",
fitToScreen: true,
},
});

setTimeout(() => {
tooltip.dismiss();
}, 1500);
```

In .html:

```html


```

Custom Style(Only Android)

In App_Resources/Android/src/main/res/values/styles

```xml

<item name="ttlm_padding">25dip</item>
<item name="ttlm_backgroundColor">#000000</item>
<item name="android:textAppearance">@style/TextAppearanceCustom</item>

<item name="android:textColor">@android:color/white</item>

```

## API

```ts
export interface Options {
message: string;
view: any;
ios?: {
hasInterval?: boolean;
interval?: number;
shadow?: boolean;
cornerRadius?: number;
padding: Array;
margin: Array;
color: string;
textColor?: string;
};
android?: {
position?: ToolTipPosition;
viewType?: ToolTipViewType;
duration?: number;
fadeDuration?: number;
width?: number;
delay?: number;
hideArrow?: boolean;
style?: string;
fitToScreen?: boolean;
};
}

export declare type ToolTipPosition =
| "left"
| "up"
| "right"
| "down"
| "top"
| "bottom";
export declare type ToolTipViewType = "native";
```

## License

Apache License Version 2.0, January 2004