如图所示, 这个界面是一个视频会议的界面,最上面的窗口是自己的视频窗口,当开启摄像头时,会显示,下面的几个罗列的小窗口, 是其他人的视频窗口(希望是根据人数来动态调整窗口的大小), 如果其他人只开启声音,则只显示头像,如果开启视频则显示视频内容, 最下面的按钮是可以控制声音和视频的按钮。
现已有一个接受视频的接口,作用 : 当有人进入会议开始视频时,服务端会通知到这个接口func remoteVideoViewWasReady(muxerID: String!, videoView: UIView!)
videoView
就是返回的视频窗口内容。
我的思路是
存在的疑惑是
以上是我的问题, 有可能思路也不对,请大家指教,谢谢
If the entire interface is fixed, the number and size of blocks are fixed, and scrolling is not required, you can consider writing directly in view. Otherwise it is recommended to use CollectionView. Generally speaking, it is recommended to use CollectionView, which is more flexible to change.
Yes, if you use code to add it, you need to use code to adapt (you can also use code to add autoLayout constraints, but it is very cumbersome). Adapting with code is very simple and requires no extra effort. Just calculate the frame based on the superView's frame or screen size when setting the frame, instead of hard-coding it like "320".
Yes. If you use collectionView, you only need to worry about the size of the cell, and you don't need to worry about the position. CollectionView will arrange the positions; if you arrange the views yourself, you can only use code. The position needs to be calculated row by row from top to bottom.