headsky

2011年11月18日

IOS表格任意多行显示

@import url(http://www.cppblog.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); 因需要在表格中显示不定长数据,在网上找了下基本没有好的解决办法。自己弄了下可以实现所需功能,仍不完美!
@import url(http://www.cppblog.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);@import url(http://www.cppblog.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
具体实现方法:
1.利用 size=[[tempArray objectAtIndex:i] sizeWithFont:[UIFont systemFontOfSize:12.0] constrainedToSize:CGSizeMake(100.0f, CGFLOAT_MAX) lineBreakMode:UILineBreakModeWordWrap];
方法得到字符串的高度
2.加入UILabel子视图
UILabel *labelDes=[[UILabel alloc] initWithFrame:CGRectMake(120,10175, height+5.0f)];
    labelDes.font
=[UIFont systemFontOfSize:12];
    labelDes.textAlignment
=UITextAlignmentLeft;
    labelDes.text
=[stringArray objectAtIndex:indexPath.row];
    labelDes.numberOfLines
=(int)[rowArray objectAtIndex:indexPath.row];
    [cell.contentView addSubview:labelDes];
    [labelDes release];

posted @ 2011-11-18 17:44 张天祖 阅读(839) | 评论 (0)编辑 收藏

2010年11月30日

MFC中打印类别型录网

 CruntimeClass *pClass=RUNTIME_CLASS(CMainFrame);

       CString str;

       int y=40;

       CDC*pDC=GetDC();

       for(;,pClass!=NULL;pClass=pClass->m_pfnGetBaseClass())

       {

              str=pClass->m_lpszClassName;

              pDC->TextOut(100,y,str);

              y+=20;

}

ReleaseDC(pDC);

posted @ 2010-11-30 15:16 张天祖 阅读(1367) | 评论 (0)编辑 收藏

仅列出标题  
<2024年3月>
252627282912
3456789
10111213141516
17181920212223
24252627282930
31123456

导航

统计

常用链接

留言簿

随笔分类

随笔档案

文章档案

搜索

最新评论

阅读排行榜

评论排行榜