【问题标题】:IFTweetLabel major issue for long URLIFTweetLabel 长 URL 的主要问题
【发布时间】:2012-07-16 11:31:01
【问题描述】:

以下开源主要用于超链接网址,电话号码。等等/ https://github.com/clawoo/IFTweetLabel

但是这个开源有一个主要问题是如果太长(超过1行)它永远不会超链接

我尝试使用以下网址,它只超链接第一行而不是 3 行 http://2.bp.blogspot.com/_wuODgRtiCUY/TO2W2EqC2hI/AAAAAAAAAEA/PbwTm9Cl8As/s1600/Shining-Apple-Logo-759135.jpg

请发布一些解决方案或任何其他好的开源。

谢谢

【问题讨论】:

  • 我也有同样的问题。
  • 我一直在寻找解决这个问题的方法。

标签: iphone url uilabel detection


【解决方案1】:

刚刚找到解决方案。

注释掉代码:

//BOOL breakWidth = NO;

/*if (currentSize.width > frame.size.width)
{
// the width of the text in the frame caused the line to break
    //NSLog(@"------ scanText = '%@', currentSize = %@", scanText,       
    //NSStringFromCGSize(currentSize));
      breakWidth = YES;

  }*/

现在它不会检查字符串的宽度(或 1 行的结尾),而是会检查整个字符串,直到得到换行符为止。

【讨论】:

  • 好的,但是如果你注释掉 //BOOL breakWidth = NO;它破坏了 IFTweet 中的其他几行代码。特别是第 278 行 if (breakLine || breakWidth) { 你对此有何解释?
猜你喜欢
  • 2010-12-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-07-15
  • 2011-04-09
  • 1970-01-01
  • 2011-12-29
相关资源
最近更新 更多