我已经指定了卡片的框架,为什么我不能将这张卡片添加到滚动视图中?
当我尝试将它添加到 UIScrollView 时,它只会变成一个带条。无法显示内容(标签)或工具栏(带有标题和详细信息以及图标按钮)。
滚动视图的代码
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!)