Notification
以下の記事は、Tizen SDK Dev Guide にあるNotification の日本語訳です。
その他のドキュメントの日本語訳はTIZEN 2.0 SDK Dev Guide 日本語訳 目次をご覧ください。
Notification
Notificationウィジェットは通知機能を提供して画面上にポップアップウィンドウを表示します。
アプリケーションに通知ウィジェットを追加するには、次のコードを使用します。
<div data-role="page">
<div data-role="notification" data-type="tickernoti">
<p>text1</p>
<p>text2</p>
</div>
<div data-role="header"></div>
<div data-role="content"></div>
<div data-role="footer"></div>
</div>
<script type="text/javascript">
$('#notification-demo').bind('tapped', function (e, m)
{
// Notification is tapped with parameter m
});
</script>
次の表でNotificationのオプションを説明します。
オプション | 入力タイプ | 説明 |
---|---|---|
data-type | 文字列 | Notificationのタイプを設定します。値はtickernoti 、smallpopup のどちらかになります。デフォルトの値は smallpopup です。 |
次のリストでNotificationが使用できるメソッドについて説明します。
open
Notificationウィジェトを表示するには
open
メソッドを使用します。<div data-role="notification" data-type="tickernoti" data-interval="3000"></div> $('#notification').notification('open');
close
Notificationウィジェトを非表示にするには
close
メソッドを使用します。<div data-role="notification" data-type="tickernoti" data-interval="3000"></div> $('#notification').notification('close');
text
Notificationの文字を取得、設定するには
text
メソッドを使用します。<div data-role="notification" data-type="tickernoti" data-interval="3000"></div> // Set notification text $('#notification').notification('text', 'setThisText'); // Get notification text texts = $('#notification').notification('text');
注意 NotificationウィジェットはTizen2.0以降でサポートされています。 icon
icon
メソッドはティッカーNotificationアイコンを設定するために使用します。Notificationタイプが
tickernoti
のときのみicon
は設定することができます。<div data-role="notification" data-type="tickernoti" data-interval="3000"></div> $('#notification').notification('icon', './test.png');
次に読むドキュメント
日本語訳: yasuyk
This content is licensed under Creative Commons Attribution 3.0. For details, see the Content License.