0

我正在使用 Xamarin 工具并尝试使用 LoadNib 加载视图,然后将其添加到 UIScrollView。我做错了什么。视图显示,但我无法让它滚动。代码如下。我究竟做错了什么?

public override void ViewDidLoad ()
{
    base.ViewDidLoad ();

    // Perform any additional setup after loading the view, typically from a nib.
    scrollView = new UIScrollView (
        new RectangleF (0, 0, View.Frame.Width
                    , View.Frame.Height - NavigationController.NavigationBar.Frame.Height));
    View.AddSubview (scrollView);

    var arr = NSBundle.MainBundle.LoadNib("AboutView", this, null);
    var v = Runtime.GetNSObject(arr.ValueAt(0)) as UIView;
    scrollView.ContentSize = v.Frame.Size;
    scrollView.AddSubview(v);
 }
4

1 回答 1

0
this. scrollView.ContentOffset = new PointF(320,480);
SizeF size = new SizeF(320,315);

this.scrollMonth.ContentSize = size; 
this.viewNewRecord.Hidden = false;

如果您正在从 xib 加载滚动,您可以检查属性反弹更改滚动视图的内容大小,然后我认为它显示

于 2013-10-22T08:49:32.847 回答