[英]tableview scroll choppy on iphone 6s
我有 2 個項目,最近注意到滾動 tableview 並不順暢。 它並不可怕,但也沒有想象的那么好。 在我的 iphone 4s 上運行項目非常流暢。 我的單元格設置確實有 2 個圖像和一個日期格式化程序,但它在 4s 上運行良好的事實令人困惑。 有沒有其他人遇到過這個問題。 我已經在網上查看並沒有找到任何解決方案。 我試過一次取出一件物品,但沒有運氣。
var current : message
var subject : String
var body : String
var status = "sent"
if sentorreceived == "received" {
status = Array.messages[indexPath.row].isread
current = Array.messages[indexPath.row]
} else {
status = sentArray.messages[indexPath.row].isread
current = sentArray.messages[indexPath.row]
}
let cell = tableView.dequeueReusableCellWithIdentifier("reuseIdentifier", forIndexPath: indexPath) as! inboxcell
subject = current.subject
body = current.body
let thecorrectdate = self.datehelper(current.date)
cell.bodyfield.text = body
cell.subjectfield.text = subject
cell.datefield.text = thecorrectdate
cell.fromfield.text = current.from
if current.messagetype == "PAGE" {
cell.priority.hidden = false
} else {
cell.priority.hidden = true
}
if current.attachments.count == 0 {
cell.paperclip.hidden = true
} else {
cell.paperclip.hidden = false
}
var status = "sent"
if sentorreceived == "received" {
status = Array.messages[indexPath.row].isread
} else {
status = ArraySent.messages[indexPath.row].isread
}
var imagestring : String?
switch status {
case "SENT":
imagestring = "SentMessageiOSIcon"
case "DELIVERED":
imagestring = "DeliveredMessageiOSIcon"
case "REPLIED":
imagestring = "RepliedSentMessageiOSIcon"
case "READ":
imagestring = "ReadMessageSentiOSIcon"
case "FAILED":
imagestring = "FailedMessageiOSIcon"
case "PAGEROFF":
imagestring = "OffMessageiOSIcon"
default:
imagestring = "SentMessageiOSIcon"
}
if sentorreceived == "sent" {
let theimage = UIImage(named: imagestring!)
cell.envelope.contentMode = UIViewContentMode.ScaleAspectFit
cell.envelope.clipsToBounds = true
cell.envelope.image = theimage
} else {
if status == "DELIVERED" {
let theimage = UIImage(named: "UnreadMessageiOSIcon")
cell.envelope.contentMode = UIViewContentMode.ScaleAspectFit
cell.envelope.clipsToBounds = true
cell.envelope.image = theimage
} else {
let theimage = UIImage(named: "ReadMessageiOSIcon")
cell.envelope.contentMode = UIViewContentMode.ScaleAspectFit
cell.envelope.clipsToBounds = true
cell.envelope.image = theimage
}
}
return cell
}
事實證明,它與代碼無關。 我需要在手機上運行從 9.0.2 到 9.1 的更新。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.