0
www.facebook.com是一個鏈接,但鼎盛時期一個UITableView只是一個文本和它被顯示爲鏈接我有有活力的細胞,當我再滾動它在一些中一個UITextView的SimpleText細胞被檢測爲紐帶
我有一個UITableView
它有動態單元格,當我滾動它然後在一些單元格中,UITextView
中的簡單文本被檢測爲鏈接。
請參閱下面的屏幕截圖。
www.facebook.com是一個鏈接,但鼎盛時期一個UITableView只是一個文本和它被顯示爲鏈接我有有活力的細胞,當我再滾動它在一些中一個UITextView的SimpleText細胞被檢測爲紐帶
我有一個UITableView
它有動態單元格,當我滾動它然後在一些單元格中,UITextView
中的簡單文本被檢測爲鏈接。
請參閱下面的屏幕截圖。
{
if person.valueForKey("type") as? String == Content_Type.CONTENT_TYPE_AUDIO
{
let cellIdentifier = "senderAudio"
let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as! SenderAudioTableViewCell
cellHeight[indexPath.row] = "Audio"
cell.audioContent.layer.cornerRadius = 10
if NSData(contentsOfFile: (person.valueForKey("lurl") as? String)!) != nil
{
cell.senderAudioButton.setImage(UIImage(named: "ic_play_circle_outline_2x.png"), forState: UIControlState.Normal)
cell.senderAudioButton.setImage(UIImage(named: "ic_stop_2x.png"), forState: UIControlState.Selected)
cell.senderAudioButton.addTarget(self, action: "buttonAction:", forControlEvents: UIControlEvents.TouchUpInside)
self.audioDict[indexPath.row] = (person.valueForKey("lurl") as? String)!
cell.senderAudioButton.tag = indexPath.row
}
else
{
SocketClient.updateLurlForCorruptImage((person.valueForKey("lurl") as? String)!, mid: (person.valueForKey("id") as? String)!)
}
var messagetime = (person.valueForKey("tim") as? String)!
messagetime = messagetime.stringByReplacingOccurrencesOfString("\\Optional[(](\\w+)[)]", withString: "$1", options: NSStringCompareOptions.RegularExpressionSearch, range: Range<String.Index> (start: messagetime.startIndex, end: messagetime.endIndex))
let timeinterval = Double(messagetime)
let date = NSDate(timeIntervalSince1970: timeinterval!/1000)
cell.audioSentTimeLabel.text = SocketClient.getLocalTimeWithAMPM(date)
cell.audioSentTimeLabel.textColor = UIColor(red: 171/255, green: 172/255, blue: 172/255, alpha: 1.0)
if person.valueForKey("mst") as? String == "1"
{
cell.audioSentStatus.image = UIImage(named: "mesagesingletick-01.png")
}
else
{
cell.audioSentStatus.image = UIImage(named: "mesageloading-01.png")
}
cell.setNeedsUpdateConstraints()
cell.updateConstraintsIfNeeded()
return cell
}
else
{
let cellIdentifier = "senderMessage"
let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as! SenderMessageTableViewCell
cell.messageContentView.layer.cornerRadius = 10
var messagetime = (person.valueForKey("tim") as? String)!
messagetime = messagetime.stringByReplacingOccurrencesOfString("\\Optional[(](\\w+)[)]", withString: "$1", options: NSStringCompareOptions.RegularExpressionSearch, range: Range<String.Index> (start: messagetime.startIndex, end: messagetime.endIndex))
let timeinterval = Double(messagetime)
let date = NSDate(timeIntervalSince1970: timeinterval!/1000)
cell.timeLabel.text = SocketClient.getLocalTimeWithAMPM(date)
cell.timeLabel.textColor = UIColor(red: 171/255, green: 172/255, blue: 172/255, alpha: 1.0)
if person.valueForKey("mst") as? String == "1"
{
cell.messageSendingStatus.image = UIImage(named: "mesagesingletick-01.png")
}
else
{
cell.messageSendingStatus.image = UIImage(named: "mesageloading-01.png")
}
cell.messageTextview.text = person.valueForKey("body") as? String
cell.messageTextview.sizeToFit()
cellHeight[indexPath.row] = cell.messageTextview.frame.height
cell.setNeedsUpdateConstraints()
cell.updateConstraintsIfNeeded()
return cell
}
}
@EI標題代碼已被添加。 –
你可以發佈的tableview單元代碼 –