Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Unable to set frame with STSSDKPlayerView #43

@idlycyme

Description

@idlycyme

母畫面:
xib 裡有個加了四邊constraint跟superview一樣大的STSSDKPlayerView (ib outlet),STSSDKPlayerView的superview為xib本身的view。

子畫面:在獨立的pip view controller中,加入由母畫面傳入的STSSDKPlayerView,給定大小位置(無constraint)
pan gesture:改變子畫面的center
display function:
{
....
self.pipView = view; // view's class is STSSDKPlayerView
//self.pipView.translatesAutoresizingMaskIntoConstraints = YES;
self.pipView.frame = [self pipFrameAtCorner:corner marginX:marginX marginY:marginY size:size];

[self.view addSubview:self.pipView];

}

pan gesture handler:
{
... compute new center ...
self.pipView.center = $new_center;
}

Issue:
無法指定子畫面位置與大小

測試:

  1. 將line 9的view由STSSDKPlayerView換成uiimage,行為正常。
  2. 將line 2所指母畫面xib,STSSDKPlayerView跟superview間(leading,trailing,top,bottom)constraints拿掉,行為正常。
  3. 將line 10的self.pipView.translatesAutoresizingMaskIntoConstraints = YES; unmark,行為正常。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions