留言置顶 window 点赞 whatsapp

Message top window like whatsapp

我正在尝试在我的应用程序中创建热门消息(iOS、Android)。 推送通知到达时将显示此消息,但我无法做到。 这是我正在使用的代码。

var MessageWindow = require('js/messageWindow'),
    messageWin = new MessageWindow();   
    messageWin.setLabel( "Probando mensajes en la parte superior" );
    messageWin.open();
    setTimeout(function(){  messageWin.close({opacity:0,duration:500}); },3000);

消息Window是:

function MessageWindow() {
var win = Titanium.UI.createWindow({
top: 0,
    height: '30%',
    width: '98%',
    borderRadius:10,
    touchEnabled:false, 
});
var messageView = Titanium.UI.createView({
    id:'messageview',
    height:'25%',
    width: '95%',
    borderRadius:10,
    backgroundColor:'#000',
    opacity:0.7,
    touchEnabled:false
});
var messageLabel = Titanium.UI.createLabel({
    id:'messagelabel',
    text:'',
    color:'#fff',
    width: '85%',
    height:'auto',
    font:{
        fontFamily:'Helvetica Neue',
        fontSize:13
    },
    textAlign:'center'
});
messageView.add(messageLabel);  
win.add(messageView);
this.setLabel = function(_text) {
    messageLabel.text = _text;
};
this.open = function(_args) {
    win.open(_args);
};
this.close = function(_args) {
    win.close(_args);
}; }module.exports = MessageWindow;

这里有我要的截图

我在 Window 中尝试了多种配置但没有成功.. 提前致谢

您可以使用 this widget Ti.Notifications