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

Landscape and portrait modes for android

$
0
0

platfrom : Android SDK : 3.1.3GA Hi Iam facing a problem when Iam designing for both modes in Android, I used this code for orientation.

Ti.Gesture.addEventListener('orientationchange',function(e) {
    Ti.App.fireEvent('orient', {portrait:e.source.isPortrait()});
});
Ti.App.addEventListener('orient', function(evt) {
        if(evt.portrait===true) {
        view1.height='8%';
} else {
        view1.height='10%';
}
    });
 
var view1 = Ti.UI.createView({
    top:'0%',
    height:(Titanium.UI.isPortrait()) ?'8%':'10%',
    width:'100%',
    //backgroundColor:'#5973b0'
    backgroundImage:'/images/header.png'
 
});
win1.add(view1);
Iam getting error in android Object UI has no method isPortrait(). its working in ios, but not in android, please help me guys. Thanks PRASHAANTH

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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