Post

Replies

Boosts

Views

Activity

How to change the AVMutableVideoCompositionLayerInstruction 's transform anchor point to center?
What I want is to make video 's rotation be from 0 to 90 degree in 0 ~ 2s. Here is the code: let layerIns = AVMutableVideoCompositionLayerInstruction(assetTrack: track) let endTransform = CGAffineTransform(rotationAngle: CGFloat(Double.pi / 2)) let timeRange = CMTimeRange(start: .zero, duration: CMTime(seconds: 2, preferredTimescale: 600)) layerIns.setTransformRamp(fromStart: .identity, toEnd: endTransform, timeRange: timeRange) But the center of rotation is top-left corner.. Which makes rotation effect look strange. I wonder how to change the video layer's anchor point to center point instead of top-left corner... related question on StackOverFlow :Question Link - https://stackoverflow.com/questions/65575655/how-to-change-the-settransformramp-s-transform-anchor-point
1
0
824
Jan ’21
When the collectionView is too high or too wide,a lot of cell maybe be created
When I set like this:  collectionView.frame = .init(x: 0, y: 0, width: 3000, height: 100) a lot of cell will be created...But need the collectionView to be wide like this..So I can't let collectonView 's width is as wide as controller's view 's width. So I set it to 3000 (maybe more wide actually..).In this case,a lot of cell will be created and if width is larger than contentSize.width ..the cell's recycle system will be useless... So ,How can i let collectionView wide like this can just create the cell's I can see?
0
0
448
Dec ’20