Note that there are some explanatory texts on larger screens.

plurals
  1. POOHAttributedLabel: setLink for an URL
    primarykey
    data
    text
    <p>I need to display a link like: sitename.com/abc.html on OHAttributedLabel. And I want to setLink for this url like: userlink:sitename.com/abc.html</p> <p>Then I click the link on label, return twice click action on UIWebView delegate, one with the URL, and the other one without URL....</p> <p>I just need one click action</p> <p>What shall I do?</p> <p>Update:</p> <pre><code>////seeingUrlString = @"sitename.com/abc.html"; [_tmpContentAttributeString setLink:[NSURL URLWithString:seeingUrlString] range:hyperLinkRange]; self.contentLabel.attributedText = _tmpContentAttributeString; -(BOOL)attributedLabel:(OHAttributedLabel *)attributedLabel shouldFollowLink:(NSTextCheckingResult *)linkInfo { CustomWebView *_customWebViewa = [[CustomWebView alloc] init]; _customWebViewa.webView.scrollView.scrollEnabled = NO; _customWebViewa.webView.scrollView.bounces = NO; _customWebViewa.webView.frame = self.view.bounds; NSString *_url = [linkInfo.URL absoluteString]; if (![_url hasPrefix:HTTPPrefix]) { _url = [HTTPPrefix stringByAppendingString:_url]; } _url = [NSString stringWithFormat:@"%@%@%@", _url, Slash, NoFollow]; [self loadWebView:_customWebViewa.webView url:_url]; return NO; } </code></pre> <p>two click actions one from OHAttributedLabel delegate, the other one I dnno where it from ...</p> <p><strong>UPdate2:</strong></p> <p>Actually I just need to display a link (like: sitename.com/abc.html) on OHAttributedLabel, but do not use this link, I want user can see this is clickable link and if they tap the link, the OHAttributedLabel delegate actually fire up a custom link url, custom link url is like:</p> <p>userlink:sitename.com/abc.html</p> <p>I want OAHAtrributedLabel treat the display url as a normal string</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload