【发布时间】:2020-04-02 03:15:12
【问题描述】:
这是我第一次使用 Stack Overflow :) 希望我能找到答案并提供我的知识。
我目前正在制作一个像 Tinder 或 instagram 风格的聊天应用程序来学习 Swift。
正如您在 Tinder 上看到的,您可以滑动水平匹配的用户
https://i.stack.imgur.com/dFUcM.jpg
我想构建几乎相同的设计。
在我的 main.storyboard 上,就像
TableViewController
-collectionView
-collectionViewCell
-collectionViewFlowLayout
-tableViewCell
-contentView
像这样。
collectionView 单元格用于匹配的用户, 和 tableviewCells 用于打开的聊天室。
我已经完成了聊天室的制作。
但集合视图部分永远不会出现。 我尝试为此制作 Extension.swift 文件并输入
extension TableViewController {
class RequestCVCell: UICollectionViewCell {
@IBOutlet weak var MatchedAvatar: UIImageView!
@IBOutlet weak var MatchedName: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
MatchedAvatar.layer.cornerRadius = 30
MatchedAvatar.clipsToBounds = true
}
let horizontalView = UIView(backgroundColor: .blue)
}
}
我想构建一个类似的故事板
ViewController
-collectionView
-collectionViewCell
-collectionViewFlowLayout
-tableView
-contentView
我真的不知道为什么它不起作用。 :( 有什么办法可以像火种一样制作吗?
感谢您的阅读,抱歉我的英语缺乏解释。
【问题讨论】:
标签: ios swift tableview collectionview tinder