Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Empty Window deploying on iOS

$
0
0

Hi there, I'm developing a mobile application using Appcelerator Titanium framework. In Android, everything is working well, but I cannot say the same for iOS. When I open a new Window using this:

var User_Survey = require('/main_windows/User_Survey');
var user_Survey = new User_Survey();
user_Survey.open();
Here User_Survey.js code:
function User_Survey() {
 
    var _this = this;
 
    if (Ti.Platform.name === 'iPhone OS'){
        this.window = Titanium.UI.createWindow({
            statusBarStyle: Titanium.UI.iPhone.StatusBar.LIGHT_CONTENT,
            fullscreen:false,
            backgroundColor:'#FFFFFF',
            barColor:'#3CB7E3'
        });
        var titleLabel = Titanium.UI.createLabel({
            color:'#ffffff',
            height:'auto',
            width:'auto',
            top:10,
            font:{fontFamily:'Helvetica Neue',fontSize:17,fontWeight:'bold'},
            text:'Rilievi effettuati'
        });
        this.window.setTitleControl(titleLabel);
    }else{
        this.window = Ti.UI.createWindow({
            title: "Rilievi effettuati",
            fullscreen:false,
            windowSoftInputMode:Ti.UI.Android.SOFT_INPUT_ADJUST_RESIZE,
            backgroundColor:'#FFFFFF'
        });
   }
 
    if (Ti.Platform.name === 'iPhone OS'){
    }else{
        this.window.addEventListener('android:back', function() {
            this.close();
        });
    }
 
    var win = this.window;
 
    var actionBar;
 
    win.addEventListener("open", function() {
        if (Ti.Platform.osname === "android") {
            if (! win.activity) {
                Ti.API.error("Si è verificato un errore");
            } else {
                actionBar = win.activity.actionBar;
                if (actionBar) {
                    actionBar.backgroundImage = "images/back_action.png";
                }
            }
        }
    });
 
    if (Ti.Platform.name === 'iPhone OS'){
 
    }else{
        var activity = win.activity;
        activity.onCreateOptionsMenu = function(e) { 
            var menu = e.menu; 
            var actionBar = win.activity.actionBar; 
            actionBar.displayHomeAsUp = true;
            actionBar.onHomeIconItemSelected = function () { 
            win.close();
        }; 
 
        var surveyButton = menu.add({ 
            title : "Aggiungi un rilievo"
        }); 
 
        surveyButton.addEventListener("click", function(e) {
            openAdd(); 
        }); 
        };
    }
 
    return this.window;
}
 
module.exports = User_Survey;
This issue is driving me crazy, hope someone will help me. Thank you.

Giacomo.


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>