我正在使用最新的Monotouch 5.2.4。作为我的开发的一部分,我试图改变Popover控制器的背景边界。按照苹果文档,这可以使用从UIPopoverBackgroundView类继承的自定义类进行管理。UIPopoverController的PopoverBackroundViewClass属性丢失
所以我建立了一个这样的类,如下
public class MyPopoverBackground : UIPopoverBackgroundView
{
public MyPopoverBackground()
{
UIImageView imgBackground = new UIImageView();
UIImage img = UIImage.FromFile(@"SupportData/Popbg.png");
img.StretchableImage(18,10);
imgBackground.Image = img;
this.AddSubview(imgBackground);
}
}
创建这个类之后,我想这个观点与弹出对象我在我的视图控制器关联。它的定义如下
UIPopoverController popup = new UIPopoverController(searchPage);
popup.popOverBackroundViewClass = new MyPopoverBackground(); //This line throws compilation error
上面代码的最后一行,其中分配happing抛出编译错误(“不包含定义..”)。
这是什么意思?这在Monotouch中是不被支持的(似乎在Objective-C中被支持,因为我在网上看到很多例子)?或者我错过了一些东西。
感谢您的帮助。
感谢您的及时回复。正如你所提到的,我填补了一个错误。我很高兴看到SO被同一个产品团队密切关注和回应。保持.. – 2012-02-17 05:45:48