I have a layout in Designer which I have setup to work for all iphone and ipad portrait orientations by setting the anchors appropriately. Everything works great with the views that were added in designer because I could set the parent and anchors appropriately for each view. All the views get AutoScaled and positioned properly in the ipad and iphone screens, except....
There is one view in my layout, "TableView" which is not setup in Designer but is added in code. It does not get positioned properly in the ipad screen because I think I need to set the anchors and parent properly as I did with the views added in Designer. However I can't seem to find any property in code or any way in Designer to do this. Here is my code to add tableview:
S_L=Label1.Left
S_T=Label1.Top+Label1.Height
S_W=Label1.Width
S_H=270
TableView1.Initialize("TableView1",False)
Page1.RootPanel.AddView(TableView1, S_L, S_T, S_W, S_H) 'left,top,width,height
The parent of Label1 is a panel called "panel1" and not "main". BTW all the views have "panel1" as parent so that they can be centered properly for different screen sizes using a designer script. The TableView gets positioned properly for the base variant (I have only one variant) but is offset to the left edge for other screen sizes. Hence I presume it's because I need to set its parent to panel1 also. Question is, how do I do it? And also, how do I set the anchors as one would do in Designer.
Would appreciate any advise on this. Thanks!
There is one view in my layout, "TableView" which is not setup in Designer but is added in code. It does not get positioned properly in the ipad screen because I think I need to set the anchors and parent properly as I did with the views added in Designer. However I can't seem to find any property in code or any way in Designer to do this. Here is my code to add tableview:
S_L=Label1.Left
S_T=Label1.Top+Label1.Height
S_W=Label1.Width
S_H=270
TableView1.Initialize("TableView1",False)
Page1.RootPanel.AddView(TableView1, S_L, S_T, S_W, S_H) 'left,top,width,height
The parent of Label1 is a panel called "panel1" and not "main". BTW all the views have "panel1" as parent so that they can be centered properly for different screen sizes using a designer script. The TableView gets positioned properly for the base variant (I have only one variant) but is offset to the left edge for other screen sizes. Hence I presume it's because I need to set its parent to panel1 also. Question is, how do I do it? And also, how do I set the anchors as one would do in Designer.
Would appreciate any advise on this. Thanks!