我在 viewdidload() 中应用了以下代码,但使用此代码边框已到达但它随表格内容滚动。我想在顶部和底部修复边框。
这里我的代码是->
let topBorder = CAShapeLayer()
let topPath = UIBezierPath()
topPath.move(to: CGPoint(x: 0, y: 0))
topPath.addLine(to: CGPoint(x: tblFilter.frame.width, y: 0))
topBorder.path = topPath.cgPath
topBorder.strokeColor = UIColor.red.cgColor
topBorder.lineWidth = 1.0
topBorder.fillColor = UIColor.red.cgColor
tblFilter.layer.addSublayer(topBorder)
let bottomBorder = CAShapeLayer()
let bottomPath = UIBezierPath()
bottomPath.move(to: CGPoint(x: 0, y: tblFilter.frame.height))
bottomPath.addLine(to: CGPoint(x: tblFilter.frame.width, y: tblFilter.frame.height))
bottomBorder.path = bottomPath.cgPath
bottomBorder.strokeColor = UIColor.red.cgColor
bottomBorder.lineWidth = 1.0
bottomBorder.fillColor = UIColor.red.cgColor
tblFilter.layer.addSublayer(bottomBorder)
Run Code Online (Sandbox Code Playgroud)
给我建议,谢谢
在 EKEvent 中,一旦我没有为事件设置任何警报,我就会在日历应用程序中查看它,它会在 5 分钟前向我显示警报。为什么 ?我不明白。
我的要求
我想在给定特定时间之前设置两个警报,1 个警报,例如“5 分钟、15 分钟、30 分钟、1 小时”。需要在事件时间设置2秒警报。
在搜索如何在事件中添加警报的基础上,我为添加事件做了一些事情,但它不起作用。很多尝试但在日历中没有效果。
请参阅下面的代码,我根据我的要求尝试了两种方式,我使用开关盒,甚至尝试添加单个警报。两者都不起作用。
我该怎么办?
提出任何建议、解决方案、想法
谢谢
let event:EKEvent = EKEvent(eventStore: appleEventStore)
event.title = tempDescription
event.startDate = startDate as Date
event.endDate = endDate as Date
event.isAllDay = false
event.notes = "This is a note"
event.calendar = cal
do {
try appleEventStore.save(event, span: .thisEvent)
print("events added with dates:")
let alarm = EKAlarm(relativeOffset: 600)
event.addAlarm(alarm)
switch tempalertid {
case "1":
let aInterval: TimeInterval = -5 * 60 …Run Code Online (Sandbox Code Playgroud)