V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  q84629462  ›  全部回复第 14 页 / 共 16 页
回复总数  303
1 ... 6  7  8  9  10  11  12  13  14  15 ... 16  
@missdeer @laomo @xarrow
http://ww2.sinaimg.cn/large/88c25655jw1endx8w7mcmj20u01hcgpy.jpg
已开香港SS,仍然没有收到,点检查,检查时间会更新,但依然没反应
@rrfeng 作为开发机系统越新越好
2014-12-18 01:54:24 +08:00
回复了 wuxiao2522 创建的主题 Nexus 现准备入手 Nexus 5,求帮助。
月初在淘宝1800入的N5 美 32G
如果不是为了开发APP适配android 5,建议还是选择其它
@besto @yaoye0o

[停产咋的了?“五太子”享受安卓5.0.1]
http://news.mydrivers.com/1/353/353904.htm
2014-12-16 23:40:54 +08:00
回复了 halczy 创建的主题 问与答 鹏博士的专线网速度如何?
忘了说我在广州,楼主联系的是广州鹏博士吗?
2014-12-16 23:32:10 +08:00
回复了 halczy 创建的主题 问与答 鹏博士的专线网速度如何?
我这小区只有6M电信ADSL和长城宽带,十多年一直没光纤,只能装了长城宽带(外网速度跟6M ADSL差不多,几百KB还是有的),我也想试试专线,楼主方便给我那个专线联系方式吗?
2014-12-16 01:43:20 +08:00
回复了 akaayy 创建的主题 问与答 有没有蓝牙,机械键盘,轻巧便携,满足这三项的键盘推荐?
专门登陆回复一下:
kbtalking pro 机械键盘+全键盘+有线模式(不插usb线可以用电池)+蓝牙1对10(可快捷键切换10个已配对的设备)
RMB 1200左右。。。
2014-12-15 15:16:22 +08:00
回复了 Livid 创建的主题 macOS 升级到 Yosemite 之后,登录界面有问题
狠心全新安装yosemite的毫无问题
2014-12-14 13:52:31 +08:00
回复了 manoon 创建的主题 问与答 特---么--的-,QIHOO 和电信也太不要脸了吧!
长城宽带也经常遇到着情况,但被重定向的APP不限于360,有时候是百毒,有时候是金删,国内三大害
@imn1 在各种管家和卫士的时代,百毒和金删可是自动静默全家进驻的,百毒是去百毒软件中心下个第三方软件都带百毒全家的存在,金删依靠wps也干不少流氓事
用长城宽带等宽带,应该很多人遇到过下个exe文件或者apk文件或者ipa文件会被重定向到360,金删,百毒等相关软件,我是经常遇到。。。
作为这个大环境的受害者,我不是为360说话,只是不满你只说360,而不提其它两大害
浏览器APP足以
2014-12-06 23:10:10 +08:00
回复了 notedit 创建的主题 问与答 求 Android 平台好用的开源视频播放组件? 收费的也可以
@jox 因为都是比较复杂的html内容,Discuz的帖子内容,都懂的。。。
好蛋疼啊,进度就卡在这了。。。
@jox
截图里,左边是iOS模拟器,右边是论坛帖子网页(UITextView的textContainerInset的16已经计上了)
http://ww1.sinaimg.cn/large/746167f8gw1emzb5y7hscj20q40b80v1.jpg
由于计算出来的高度不够,最后一段被吃了显示不出来。
这情况我也不知道该怎么做高度补偿。。。
@jox 求输出位图的方法。。。反正里面的gif表情我不知道怎么样弄成动态的
@jox
找到三种计算富文本字符串高度的方法,三种方法计算出来的高度是一样的
但与shouldInteractWithTextAttachment(UITextViewDelegate点击富文本里的图片后的回调)输出的UITextView内容高度始终不同,本文最后附上了NSLog记录
ps:如果富文本字符串只包含图片,例如图片是高50的,那UITextView.contentSize.height就是66,图片是高60的,那UITextView.contentSize.height就是76,必然相差了16,求解
再ps:下文三个width参数我明明赋值了320,但NSLog出来只有318.62,求解
- (void)Calculating_Text_Height_1_Width:(CGFloat)width WithString:(NSAttributedString *)string {
NSTextStorage *textStorage = [[NSTextStorage alloc] init];
NSLayoutManager *layoutManager = [[NSLayoutManager alloc] init];
[textStorage addLayoutManager:layoutManager];
NSTextContainer *textContainer = [[NSTextContainer alloc] initWithSize:CGSizeMake(width, FLT_MAX)];
[textContainer setLineFragmentPadding:0.0];
[layoutManager addTextContainer:textContainer];
[textStorage setAttributedString:string];
[layoutManager ensureLayoutForTextContainer:textContainer];
CGRect frame = [layoutManager usedRectForTextContainer:textContainer];
NSLog(@"1:%@", NSStringFromCGRect(frame));
/*
http://www.v2ex.com/t/149498
*/
}

- (void)Calculating_Text_Height_2_Width:(CGFloat)width WithString:(NSAttributedString *)string {
CGRect frame = [string boundingRectWithSize:CGSizeMake(width, FLT_MAX) options:(NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading) context:nil];
NSLog(@"2:%@", NSStringFromCGRect(frame));
/*
http://blog.csdn.net/iunion/article/details/12185077
*/
}

- (void)Calculating_Text_Height_3_Width:(CGFloat)width WithString:(NSAttributedString *)string {
NSTextStorage *textStorage = [[NSTextStorage alloc] init];
NSLayoutManager *layoutManager = [[NSLayoutManager alloc] init];
[textStorage addLayoutManager:layoutManager];
NSTextContainer *textContainer = [[NSTextContainer alloc] initWithSize:CGSizeMake(width, FLT_MAX)];
[textContainer setLineFragmentPadding:0.0];
[layoutManager addTextContainer:textContainer];
[textStorage setAttributedString:string];
[layoutManager glyphRangeForTextContainer:textContainer];
CGRect frame = [layoutManager usedRectForTextContainer:textContainer];
NSLog(@"3:%@", NSStringFromCGRect(frame));
/*
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/TextLayout/Tasks/StringHeight.html
http://www.cocoachina.com/b/?p=160
*/
}

- (BOOL)textView:(UITextView *)textView shouldInteractWithTextAttachment:(NSTextAttachment *)textAttachment inRange:(NSRange)characterRange {
NSLog(@"img:%@", NSStringFromCGRect(textAttachment.bounds));
NSLog(@"total:%@", NSStringFromCGSize(textView.contentSize));
return true;
}

========
2014-12-05 22:04:05.640 test[3673:112783] View Controller Bounds:{{0, 0}, {320, 568}}
2014-12-05 22:04:05.641 test[3673:112783] UITextView Controller Bounds:{{0, 0}, {600, 600}}
2014-12-05 22:04:05.671 test[3673:112783] 1:{{0, 0}, {318.62, 637.36000000000001}}
2014-12-05 22:04:05.672 test[3673:112783] 2:{{0, 0}, {318.62, 637.36000000000001}}
2014-12-05 22:04:05.673 test[3673:112783] 3:{{0, 0}, {318.62, 637.36000000000001}}
2014-12-05 22:04:08.612 test[3673:112783] img:{{0, 0}, {50, 50}}
2014-12-05 22:04:08.612 test[3673:112783] total:{320, 664}
===========
@jox 求代码
首先感谢@jox,已经按照@jox的方法自行用TFHpple组建成NSAttributedString,包含的网络图片标签(<img src="http://巴拉巴拉巴拉">)也用AFNetWorking自行获取图片并用TMDIsk缓存起来了
但是由于是要放去UITableViewCell里用的,所以又有一个新问题:高度计算不正确
简单举例:
UITextView *textView;
[textView setDelegate:self];
NSTextAttachment *attachment = 长宽都是60的NSTextAttachment图片;
NSAttributedString *string = [NSAttributedString attributedStringWithAttachment:attachment];
NSLog(@"string.size:%@", NSStringFromCGSize(string.size));
//string.size:{60, 60}
CGSize size = CGSizeMake(textView.contentSize.width, CGFLOAT_MAX);
CGRect rect = [string boundingRectWithSize:size options:(NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading | NSStringDrawingUsesDeviceMetrics) context:nil];
NSLog(@"string rect:%@", NSStringFromCGRect(rect));
//string rect:{{0, 0}, {60, 60}}
[textView setAttributedText:string];
然后就是把当前的UITableViewCell的高度设为60了,结果是图片显示不全,症状是UITableViewCell的高度不足以把图片显示全
就不说多行的NSAttributedString文字,一样的症状。
@PrideChung @gonghao @jox @ld0891 各种求。
2014-11-30 11:44:51 +08:00
回复了 mikemikemike 创建的主题 程序员 mac 如何快速的并排两个窗口呢,像 windows 一样
王自如用的是window tidy
@usbaby 要找个跨国快递寄回去amazon?
@usbaby @tanyuxiang
看来我举的例子错了,其实就是想问没有全球联保的东西怎么办。。。
1 ... 6  7  8  9  10  11  12  13  14  15 ... 16  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2389 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 28ms · UTC 14:54 · PVG 22:54 · LAX 07:54 · JFK 10:54
Developed with CodeLauncher
♥ Do have faith in what you're doing.