10 2014 档案
摘要:计算NSString的字符长度,用length方法Returns the number of Unicode characters in the receiver,既是英文字符和中文汉字都是一个字符长度,如@“abcde我的”长度为7,而此长度和微博的输入字数实际上是不符的,在微博中,它的长度为5(...
阅读全文
摘要:在 iPhone 或 iPad 的开发中,除了用touchesBegan / touchesMoved / touchesEnded这组方法来控制使用者的手指触控外,也可以用UIGestureRecognizer的衍生类別来进行判断。用UIGestureRecognizer的好处在于有现成的手势,开...
阅读全文
摘要:1 - (void)webViewDidFinishLoad:(UIWebView *)webView2 { 3 NSString *height_str= [webView stringByEvaluatingJavaScriptFromString: @"document.body.off...
阅读全文
摘要:1 - (int)calc_charsetNum:(NSString*)_str 2 { 3 unsigned result = 0; 4 const char *tchar=[_str UTF8String]; 5 if (NULL == tchar) { 6 return resul...
阅读全文
摘要:在iOS中默认的UILabel中的文字在竖直方向上只能居中对齐,自定义UILabel,实现了居上对齐,居中对齐,居下对齐。具体如下: 1 // 2 // myUILabel.h 3 // 4 // 5 // Created by yex...
阅读全文

浙公网安备 33010602011771号