Skip to content

Commit 825878c

Browse files
committed
修复playButton可能被挡住的问题
1 parent 333e332 commit 825878c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

TZImagePickerController/TZImagePickerController/TZPhotoPreviewCell.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ - (void)configPlayButton {
418418
[_playButton setImage:[UIImage tz_imageNamedFromMyBundle:@"MMVideoPreviewPlay"] forState:UIControlStateNormal];
419419
[_playButton setImage:[UIImage tz_imageNamedFromMyBundle:@"MMVideoPreviewPlayHL"] forState:UIControlStateHighlighted];
420420
[_playButton addTarget:self action:@selector(playButtonClick) forControlEvents:UIControlEventTouchUpInside];
421+
_playButton.frame = CGRectMake(0, 64, self.tz_width, self.tz_height - 64 - 44);
421422
[self.contentView addSubview:_playButton];
422423
[self.contentView addSubview:_iCloudErrorIcon];
423424
[self.contentView addSubview:_iCloudErrorLabel];
@@ -475,7 +476,7 @@ - (void)configPlayerWithItem:(AVPlayerItem *)playerItem {
475476
self.playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player];
476477
self.playerLayer.backgroundColor = [UIColor blackColor].CGColor;
477478
self.playerLayer.frame = self.bounds;
478-
[self.layer addSublayer:self.playerLayer];
479+
[self.contentView.layer addSublayer:self.playerLayer];
479480
[self configPlayButton];
480481
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pausePlayerAndShowNaviBar) name:AVPlayerItemDidPlayToEndTimeNotification object:self.player.currentItem];
481482
}

0 commit comments

Comments
 (0)