Skip to content

Commit

Permalink
2.3.0 新增无序符号的配置(感谢iostang的提交),修复偶现的重新加载html卡、慢的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
rztime committed Sep 18, 2024
1 parent a155a70 commit 64f8587
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Example/RZRichTextView/HTML2AttrViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import RZRichTextView
class HTML2AttrViewController: UIViewController {

lazy var textView = RZRichTextView.init(frame: .init(x: 16, y: 100, width: qscreenwidth - 32, height: 80), viewModel: .shared(edit: true))
// .qisScrollEnabled(false)
.qisScrollEnabled(false)
.qbackgroundColor(.qhex(0xf5f5f5))
.qplaceholder("请输入内容")
// .qlinkTextAttributes([.foregroundColor: UIColor.red])
Expand All @@ -25,8 +25,8 @@ class HTML2AttrViewController: UIViewController {
UIScrollView.qbody([
textView.qmakeConstraints({ make in
make.left.equalToSuperview().inset(16)
make.top.equalToSuperview()
make.height.equalTo(300)
make.top.bottom.equalToSuperview()
// make.height.equalTo(300)
make.width.equalTo(qscreenwidth - 32)
}),
]).qmakeConstraints({ make in
Expand Down
8 changes: 5 additions & 3 deletions Example/RZRichTextView/HowToUseDemo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ public extension RZRichTextViewModel {

let viewModel = RZRichTextViewModel.init()
viewModel.canEdit = edit
viewModel.ulSymbol = ""
/// 无序符号配置
viewModel.ulSymbol = "·"
//viewModel.ulSymbol = "*"
viewModel.ulSymbolAlignment = .center
viewModel.ulSymbolFont = .systemFont(ofSize: 14, weight: .medium)
viewModel.ulSymbolAlignment = .right
/// 如果设置,将固定无序符号的font
// viewModel.ulSymbolFont = .systemFont(ofSize: 14, weight: .medium)

/// 链接颜色
viewModel.defaultLinkTypingAttributes = [.foregroundColor: UIColor.qhex(0x307bf6), .underlineColor: UIColor.qhex(0x307bf6), .underlineStyle: NSUnderlineStyle.styleSingle.rawValue]
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ it, simply add the following line to your Podfile:
pod 'RZRichTextView'
```

有时可能会有一些小更新但暂时没有更新最新版本,可以在podfile中使用
```ruby
pod 'RZRichTextView', :git => 'https://github.com/rztime/RZRichTextView.git'
```

然后执行
```ruby
pod update RZRichTextView --no-repo-update
```


## Author

rztime, rztime@vip.qq.com qq交流群:580839749
Expand Down
2 changes: 1 addition & 1 deletion RZRichTextView.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'RZRichTextView'
s.version = '2.2.0'
s.version = '2.3.0'
s.summary = 'RZRichTextView. 原生UITextView,支持富文本输入(图片,视频,列表序号,文本颜色大小各种样式等等)'

# This description is used to generate tags and improve search results.
Expand Down
2 changes: 1 addition & 1 deletion RZRichTextView/Classes/RZRichTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ public extension RZRichTextView {
if index != "" {
let rect = self.qcaretRect(for: range.location)
let view = RZTextListView.init().qframe(.init(x: 3, y: rect.origin.y, width: 30, height: rect.size.height))
.qfont(viewModel.ulSymbolFont ?? (dict[.font] as? UIFont) ?? .systemFont(ofSize: 16))
.qfont(viewModel.ulSymbolFont ?? ((dict[.font] as? UIFont) ?? .systemFont(ofSize: 16)))
.qtextColor((dict[.foregroundColor] as? UIColor) ?? .black)
.qtext("\(index)")
.qtextAliginment(viewModel.ulSymbolAlignment)
Expand Down
8 changes: 4 additions & 4 deletions RZRichTextView/Classes/RZRichTextViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ open class RZRichTextViewModel: NSObject {
/// 是否是编辑状态,true可以编辑,false时,不可删除附件以及编辑textView
/// 初始化的时候配置此项,在编辑过程中,如果想禁用编辑,直接设置textView.isEditable = false
open var canEdit: Bool = true

open var ulSymbol:String = "·"
open var ulSymbolAlignment:NSTextAlignment = .right
open var ulSymbolFont:UIFont?
/// 无序列表前序号的配置
open var ulSymbol: String = "·"
open var ulSymbolAlignment: NSTextAlignment = .right
open var ulSymbolFont: UIFont?

public override init() {
super.init()
Expand Down
6 changes: 6 additions & 0 deletions UpdataLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
* v2.3.0
* . 修复某些情况下,加载慢(目前仅发现有一个手机,安装了三方键盘,在重新编辑加载html的时候,判断键盘输入法是否中文正在输入时,无法成功获取键盘信息导致加载变慢)(很难复现)
* . 卡(也是上述手机,在初始化界面加载完且在附件加载完,在fixAttachmentViewFrame中无法获取到附件的正确位置,导致这里循环卡顿,解决方法是在这个方法里加了延迟处理)(很难复现)
* . 感谢iostang提交代码(无序符号相关的配置)


* v2.2.0
* . 修复某些情况下,图片高度显示错误
* . 添加超链接默认样式设置
Expand Down

0 comments on commit 64f8587

Please sign in to comment.