我是iPad开发人员的新手,
我使用iPad在目标c中创建了两个或三个Xcode 4.应用程序。
但是现在我想用iPad语言中的Monodeveloper工具创建C#应用程序.
其中,我想把我的tableView转移到orientation,
我在谷歌搜索,但我没有任何语法。
详情见我的屏幕快照..。
在第一个图像(纵向模式)中,我的表位于extremeLeft,在第二个图像(景观模式)中,我希望我的表处于极右。

我该怎么做?
我通过编程创建了tableview,这是代码片段,
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
Gainer(); //method call
UITableView Table=new UITableView();
Table.Frame=new RectangleF(20,200,400,400);
Table.Source=new TableViewDataSource(TopGainer); //passing parameter to tableview datasource
this.View.AddSubview(Table);
}
public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation)
{
// Return true for supported orientations
return true;
}任何帮助都将不胜感激.
,提前谢谢!!
发布于 2012-02-22 02:21:13
您可以重写WillRotate方法,并根据UIScreen.MainScreen提供的值在任何情况下应用您想要的确切位置。例如。
public override void WillRotate (UIInterfaceOrientation toInterfaceOrientation, double duration)
{
switch (toInterfaceOrientation) {
case UIInterfaceOrientation.LandscapeLeft:
case UIInterfaceOrientation.LandscapeRight:
Table.Frame = new RectangleF (UIScreen.MainScreen.Bounds.Width - 20 - Table.Frame.Width, 200, 400, 400);
break;
case UIInterfaceOrientation.Portrait:
case UIInterfaceOrientation.PortraitUpsideDown:
Table.Frame = new RectangleF (20, 200, 400, 400);
break;
}
base.WillRotate (toInterfaceOrientation, duration);
}https://stackoverflow.com/questions/9376893
复制相似问题