02-21-2011 11:33 PM
Hi,
There are few issues with my application.
Please help me to resolve these.
1. How to rotate the simulator to test landscape and portrait orientation?
2. How to make app only work in landscape mode and not in portrait mode?
3. I have a drop-down menu just above the submit button. problem is when I click the menu the drop-down list comes behind the Submit button and few of the options are not visible. Any way to overcome this?
4. Can I submit my app without code-sighning?
5. Is the free-playbook offer valid in India?
Thanks
Abhinav Tyagi
02-21-2011 11:47 PM
Got the answer to #2
Use following in appname-app.xml
<autoOrients>false</autoOrients><aspectRatio>landscape</aspectRatio>
Please help me in finding solutions for other Q.
Thanks
Abhinav
02-22-2011 12:12 AM
02-22-2011 12:46 AM
Thanks jffurlan,
I can now rotate the simulator... and also see the bugs
when I rotate and open my app, it opens correctly but small in size, but when I open my app and rotate, right half of my app goes missing!!!
Are these issues related to Simulator or coding in my App?
Please help me resolving other issues as well.
Thanks
Abhinav Tyagi
02-22-2011 12:47 AM
In Reply to Question 3:
There are two ways of going about solving that issue:
One: Simply add the drop down menu after the submit button. that way the index of the drop down menu is always higher than that of the submit button. you can also always use the setChildIndex() method to set the index manually.
Two: If you are using containers, its a little more complicated. Since the order of your children objects is taken into account with the QNX containers, you would have to do a .layout() first and then use the setChildIndex() method on the dropdown menu and set it to an index that is higher than the submit button. the only problem with that is the next time you do the .layout() it will mess up the way everything looks due to the change of child order. so the workaround for that is to "reset" the child index of the drop down menu and then do the layout() method and then do the setChildIndex() method again to set the drop down's index to the a number higher than the submit button.
good luck!
02-22-2011 12:50 AM
abhi007tyagi wrote:
Thanks jffurlan,
I can now rotate the simulator... and also see the bugs
when I rotate and open my app, it opens correctly but small in size, but when I open my app and rotate, right half of my app goes missing!!!
Are these issues related to Simulator or coding in my App?
Please help me resolving other issues as well.
Thanks
Abhinav Tyagi
There is indeed a bug that does not correctly orient an application that can only be done in one mode (landscape or portrait). As long as your app does not rotate while its the active application and maximized, you should be good to go.
02-22-2011 11:23 AM
Thanks JRAB
but I don't have any clue of layout !!!
can you explain with some coding??
here is part of my code for dropdown and button
dd = new DropDown();
dd.rowHeight = 23;
dd.width = 320;
dd.dataProvider = new DataProvider(ar);
dd.addEventListener(Event.SELECT, dropDownData);
mySub.addChild(dd);
mySubLeft.addChild(mySub);
//----------Button-------------------------------
calculateButton = new LabelButton();
calculateButton.label = "Calculate";
calculateButton.sizeUnit = SizeUnit.PERCENT;
calculateButton.sizeMode = SizeMode.BOTH;
calculateButton.addEventListener(MouseEvent.CLICK
mySubLeft.addChild(calculateButton);
Note: dd & button are in diff containers
Thanks
Abhinav Tyagi
02-22-2011 02:00 PM
hey abhi,
try doing this after at the end of your program:
mySubLeft.swapChildren(mySub, calculateButton);
This should lay the dropdown container on top of the button without altering the way the container looks. just remember to swap the children again before doing any .layout() methods on the containers. good luck!
02-23-2011 12:45 AM
Thanks JRAB,
But this only swapped the dropdown menu and button
It is of no use ![]()
Thanks
Abhinav Tyagi
02-23-2011 01:42 AM
not sure if you are implementing it correctly. this is what i had in mind about the swapChildren method:
ContainerTest.as:
package
{
import flash.display.Shape;
import flash.display.Sprite;
import flash.text.TextFieldAutoSize;
import qnx.ui.buttons.LabelButton;
import qnx.ui.core.Container;
import qnx.ui.core.ContainerAlign;
import qnx.ui.core.ContainerFlow;
import qnx.ui.core.SizeUnit;
import qnx.ui.core.Spacer;
import qnx.ui.data.DataProvider;
import qnx.ui.listClasses.DropDown;
import qnx.ui.listClasses.List;
import qnx.ui.listClasses.ListSelectionMode;
import qnx.ui.listClasses.ScrollDirection;
import qnx.ui.listClasses.ScrollPane;
import qnx.ui.text.Label;
[SWF(width="1024", height="600", backgroundColor="#CCCCCC", frameRate="30")]
public class ContainerTest extends Sprite
{
private var mainContainer:Container;
private var topContainer:Container;
private var bottomContainer:Container;
private var containerMargin:int = 10;
private var myList:DropDown;
private var myDataProvider:DataProvider;
private var myArray:Array;
private var btn:LabelButton;
public function ContainerTest()
{
super();
mainContainer = new Container();
mainContainer.margins = Vector.<Number>([containerMargin,containerMargin,containerMargin,containerMargin]);
mainContainer.flow = ContainerFlow.VERTICAL;
mainContainer.align = ContainerAlign.NEAR;
mainContainer.setSize(1024, 600);
topContainer = new Container();
topContainer.margins = Vector.<Number>([containerMargin,containerMargin,containerMargin,containerMargin]);
topContainer.debugColor = 0xFF0000;
topContainer.size = 50;
topContainer.sizeUnit = SizeUnit.PERCENT;
mainContainer.addChild(topContainer);
bottomContainer = new Container();
bottomContainer.margins = Vector.<Number>([containerMargin,containerMargin,containerMargin,containerMargin]);
bottomContainer.debugColor = 0xFFFF00;
bottomContainer.size = 50;
bottomContainer.sizeUnit = SizeUnit.PERCENT;
mainContainer.addChild(bottomContainer);
myList = new DropDown();
myArray = new Array();
myArray.push({label: "Thomas Luddington"});
myArray.push({label: "Master Maruyn"});
myArray.push({label: "Master Gardyner"});
myArray.push({label: "Captain Vaughan"});
myArray.push({label: "Master Kendall"});
myArray.push({label: "Master Prideox"});
myArray.push({label: "Robert Holecroft"});
myArray.push({label: "Rise Courtenay"});
myArray.push({label: "Master Hugh Rogers"});
myArray.push({label: "Thomas Foxe"});
myArray.push({label: "Edward Nugen"});
myArray.push({label: "Darby Glande"});
myArray.push({label: "Edward Kelle"});
myArray.push({label: "Iohn Gostigo"});
myArray.push({label: "Erasmus Clefs"});
myArray.push({label: "Edward Ketcheman"});
myArray.push({label: "Iohn Linsey"});
myArray.push({label: "Thomas Rottenbury"});
myArray.push({label: "Roger Deane"});
myArray.push({label: "Iohn Harris"});
myDataProvider = new DataProvider(myArray);
myList.dataProvider = myDataProvider;
myList.setPosition(100,25);
myList.width = 300;
topContainer.addChild(new Spacer());
topContainer.addChild(myList);
btn = new LabelButton();
btn.label = "Test Button";
btn.setSize(150,52);
bottomContainer.addChild(btn);
mainContainer.layout();
addChild(mainContainer);
/**
* This should do the trick for you here.
*/
mainContainer.swapChildren(topContainer,bottomContainer);
}
}
}
Comment and uncomment that line to see the difference. hope that can shed some light on the issue. good luck!