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この回答はあなたのために機能しましたか? –