开发者

NSScrollView subviews are all on top of eachother

Ok, I'm trying 开发者_Go百科to add alot of subviews (same type of view, just displaying difrent information) to a NSScrollView, but everytime i add a subview (code below) it just adds the view on top of the view already in place. How can I add a subview, which is placed below the other views in the NSScrollView?

        using (var pool = new NSAutoreleasePool ()) {
            var Widget = new TvShowWidgetController ();
            ScrollView.AddSubview (Widget.View);
        }


You need to set the Frame of the Widget.View before adding it to the scrollview.

Also note that you're allowing the controller to get collected. Controllers own and reference views, but views do not own and reference controllers, so you should keep a reference to your controller list.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜