Re: How to set up my NSViews?
Re: How to set up my NSViews?
- Subject: Re: How to set up my NSViews?
- From: Andreas Falkenhahn <email@hidden>
- Date: Wed, 07 Sep 2016 17:02:33 +0200
On 06.09.2016 at 21:22 Kyle Sluder wrote:
> On Tue, Sep 6, 2016, at 01:38 PM, Andreas Falkenhahn wrote:
>> On 06.09.2016 at 18:51 Ken Thomases wrote:
>> > On Sep 6, 2016, at 11:41 AM, Andreas Falkenhahn <email@hidden> wrote:
>> >> My NSWindow contains an NSView which I use to draw custom graphics to. It doesn't
>> >> contain any widgets like buttons at all, just custom graphics drawn in drawRect().
>> >> Now I'd like to have an AVPlayerView NSView on top of this view. Thus, I tried to
>> >> add this AVPlayerView on top of the NSView by doing the following:
>> >> [view addSubview:playerview];
>> >> However, this didn't work and generated lots of debug output to stderr.
>> > What, specifically, does "this didn't work" mean? What debug output was logged?
>> Well, this list has a limit of 25kb per mail, so here is just the first
>> 20% of what
>> was logged:
>> (
>> "<NSLayoutConstraint:0x1086476e0 H:|-(0)-[NSView:0x108633860] (Names:
>> '|':MyAVPlayerView:0x1004f5b70 )>",
>> [:snip:]
>> Let me know if you need more :)
> It looks like the constraints that AVPlayerView uses to manage its own
> internal layout are in conflict with its frame. Did you give the
> AVPlayerView a non-zero frame before inserting it as a subview?
Yes.
> If
> you’re trying to position it using Auto Layout, did you remember to turn
> .translatesAutoresizingMaskIntoConstraints off?
I'm not using Auto Layout.
As Richard pointed out, I think AVPlayerView might not be compatible with a custom-drawn
NSView. But it doesn't matter since I'm now using AVPlayerLayer and this works fine
when added as a sublayer to my NSView's layer.
--
Best regards,
Andreas Falkenhahn mailto:email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden