1
AVPlayerLayer
을 셀 공간을 채우려 고했지만 프레임 속성을 설정하여 크기가 변경되지 않았습니다. 내 uitableviewcontroller
파일에 다음AVPlayerLayer가 셀 경계로 크기가 변경되지 않습니다.
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
let videoURL = NSURL(string: "https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
let player = AVPlayer(url: videoURL! as URL)
let playerLayer = AVPlayerLayer(player: player)
playerLayer.frame = contentView.bounds;
contentView.layer.addSublayer(playerLayer)
player.play()
}
:
내 사용자 정의 셀 파일에서override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "clipHomeCells", for: indexPath) as! ClipTableViewCell
// Configure the cell...
return cell
}
그러나 그것은 다음과 같습니다
@wtfislife,이 답변이 도움이 되었습니까? –