We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
你好,我看了你的示例代码,里面有把html转变成NSAttributedString的方法
NSAttributedString *attributeString = [NSAttributedString htmlString:html]; ...... cell.textLabel.attributedText = attributeString;
但是,如果html里面有图片,比如
<img src=“https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1574248377078&di=cf53e56d95c97225082e2063d94fb151&imgtype=0&src=http%3A%2F%2Fi1.sinaimg.cn%2Fent%2Fd%2F2008-06-04%2FU105P28T3D2048907F326DT20080604225106.jpg” />
要如何给这个图片添加点击事件呢?
The text was updated successfully, but these errors were encountered:
你好,我看了你的示例代码,里面有把html转变成NSAttributedString的方法 NSAttributedString *attributeString = [NSAttributedString htmlString:html]; ...... cell.textLabel.attributedText = attributeString; 但是,如果html里面有图片,比如 <img src=“https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1574248377078&di=cf53e56d95c97225082e2063d94fb151&imgtype=0&src=http%3A%2F%2Fi1.sinaimg.cn%2Fent%2Fd%2F2008-06-04%2FU105P28T3D2048907F326DT20080604225106.jpg” /> 要如何给这个图片添加点击事件呢?
要实现点击事件,用UITextView 1. self.textView2.rzDidTapTextView = ^BOOL(id _Nullable tapObj) { NSLog(@"%@", tapObj); return NO; };
self.textView2.rzDidTapTextView = ^BOOL(id _Nullable tapObj) { NSLog(@"%@", tapObj); return NO; };
2.两种方式 a. 给image加一个链接 <a(标签) href = "http://clickedimage" > b.先转换为NSAttributedString, 然后找到里边的图片,然后给图片添加一个tapAction demo: - getCache:
Sorry, something went wrong.
No branches or pull requests
你好,我看了你的示例代码,里面有把html转变成NSAttributedString的方法
NSAttributedString *attributeString = [NSAttributedString htmlString:html];
......
cell.textLabel.attributedText = attributeString;
但是,如果html里面有图片,比如
<img src=“https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1574248377078&di=cf53e56d95c97225082e2063d94fb151&imgtype=0&src=http%3A%2F%2Fi1.sinaimg.cn%2Fent%2Fd%2F2008-06-04%2FU105P28T3D2048907F326DT20080604225106.jpg” />
要如何给这个图片添加点击事件呢?
The text was updated successfully, but these errors were encountered: