iOS Swift UITextView当文本长于TextView时,在TextView中显示...

时间:2018-07-12 06:10:25

标签: ios swift uitextview

我的TextView第一次是自动创建新行,如果文本超出textview

但是运行此代码后无法自动创建新行

Cell.swift中:

@IBAction func ModifyBtn(_ sender: Any) {
  if isMine {
     let tableView = self.superview as! UITableView
      for cell in tableView.visibleCells{
          cell.setSelected(false, animated: false)
          (cell as! SubViewReplyCell).noneSelected()
      }
      self.setSelected(true, animated: false)
      Modified() // Modified is change layer color
      replyPage.subViewReply.seletedReply = replyUID
      replyPage.modifyReplyArea(replyContent.attributedText!)
      print("Reply Modify Button")
  }

TableView.swift中:

func modifyReplyArea(_ beforeContent:NSAttributedString){
   isModify = true

   replyCloseButtonWidth.constant = 25
   replyArea.attributedText = beforeContent
   replyArea.selectedRange = NSMakeRange(replyArea.attributedText.length, 0);
   titleLabel.textColor=UIColor.red

   titleLabel.text = "Modify"
}

修改按钮,单击以运行此代码

这是第一次运行:

first

点击修改后:

after click modify

UITextView的选项“隐式更改”?

0 个答案:

没有答案