Size of scrollview changes after opening photogallery.

You must Login before you can answer or comment on any questions.

Hi, I am developing an iphone app on Titanium 2.1.0 and iOS 5.0. I am stucked in a strange situation. I've three buttons on a scrollview when I open photogallery and comeback from it the last button on the scrollview slides down the screen and and never show its face so that it can be clicked. Here is my code, plz tell me what am I doing wrong:-

var win_newListing=Ti.UI.createWindow({
    width: Ti.Platform.displayCaps.platformWidth,
    height: Ti.Platform.displayCaps.platformHeight,
    top:0,
    left:0,
    backgroundColor:'black'
});
 
var scroll=Ti.UI.createScrollView({
    top:0,
    left:0,
    contentHeight:'auto',
    contentWidth:'auto',
    height: Ti.UI.FILL,
    width:Ti.UI.FILL
})
 
var lbl_newLisings=Ti.UI.createLabel({
    text:'Create New Listings',
    color: 'yellow',
    font: {fontSize:20,fontWeight:'bold'},
    widht:150,
    height:25,
    top: 50
});
 
var txt_pp=Ti.UI.createTextField({
    hintText: 'Proposed Price',
    borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,   
    top: 395,
    width: '75%',
    height: 35,
});
 
var btn_photo=Ti.UI.createButton({
    title: 'Upload Photo From Gallery',
    top: 450,
    height: 35
})
 
var btn_tkphoto=Ti.UI.createButton({
    title: 'Take Photo or Video By Camera',
    top: 495,
    height:35
})
 
var btn_addlisting=Ti.UI.createButton({
    title: 'Add Listing',
    top: 550,
})
 
scroll.add(lbl_newLisings);
 
scroll.add(btn_photo);
scroll.add(btn_tkphoto);
scroll.add(btn_addlisting);
 
win_newListing.add(scroll);
win_newListing.open();
 
var car_pic;
btn_photo.addEventListener('click',function(e)
        {
            Ti.Media.openPhotoGallery({success:success,cancel:cancel,error:error,allowImageEditing:true});
        });
 
var success=function(event) {       car_pic=event.media;    };
var cancel=function(){          alert('you canceled');      };
var error=function(error){      alert('there was an error');}
I am stucked very hard for a week so plz help ASAP. Many thanks in advance.

— asked 10 months ago by Muhammad Qasim Khan
3 Comments
  • Hi Muhammad Qasim Khan,

    I have tested your code in simulator and it works. Have you try after clean build?.

    — commented 10 months ago by Nitin Chavda

  • Ok, yes it is working alone here but not in my project where I am putting Dan Tamas's combo boxes (proposed in cssgallery.info) on the scrollview. When I open the photo gallery and select an image the last button on the scrollview slides down the screen and never show up till keyboard isn't opened. I noticed when keyboard is opened and returned everything is settled down! ! !

    — commented 10 months ago by Muhammad Qasim Khan

  • then you need to post a complete example for us to reproduce the problem.... posting code that works fine is of no use to help you with your problem.

    — commented 10 months ago by Aaron Saunders

Your Answer

Think you can help? Login to answer this question!