我已经指定了卡的框架,为什么我不能将此卡添加到scrollView?
当我尝试将其添加到UIScrollView时,它将变成一个条形图。无法显示内容(标签)或工具栏(带标题和详细信息以及IconButton)。
scrollView代码
eventList = UIScrollView()
eventList?.frame = CGRect(x: 0, y: (calender?.frame.height)! + (calenderMenu?.frame.height)!, width: ScreenWidth, height: ScreenHeight - (calenderMenu?.frame.height)! - (calender?.frame.height)!)
eventList?.scrollsToTop = true
eventList?.isScrollEnabled = true
eventList?.bounces = true
eventList?.isPagingEnabled = true
eventList?.indicatorStyle = .default
eventList?.contentSize = CGSize(width: ScreenWidth - 20, height: 400)
eventList?.delegate = self
self.view.addSubview(eventList!)
卡片代码
signinCard = Card()
signinCard?.frame = view.bounds
signinCard?.toolbar = signinToolbar
signinCard?.toolbarEdgeInsetsPreset = .square3
signinCard?.toolbarEdgeInsets.bottom = 0
signinCard?.toolbarEdgeInsets.right = 8
signinCard?.contentView = contentView
signinCard?.contentViewEdgeInsetsPreset = .wideRectangle3
signinCard?.bottomBar = Bar()
signinCard?.frame = CGRect(x: 10, y: 10, width: ScreenWidth - 20, height: (eventList?.frame.height)! / 2 - 5)
eventList?.addSubview(signinCard!)