#define LINENUM 20 //行宽
#define LINEHEIGHT 20 //行高
int begin=0;
NSString *partialString;
NSString* str=@"东南形胜,三吴都会,钱塘自古繁华。烟柳画桥,风帘翠幕,参差十万人家。云树 绕堤沙,怒涛卷霜雪,天堑无涯。市列珠玑,户盈罗绮,竞豪奢。重湖叠清嘉,有三秋桂子,十里荷花。羌管弄晴,菱歌泛夜,嬉嬉钓叟莲娃。千骑拥高衙,乘醉听箫鼓,吟赏烟霞。异日图将好景,归去凤池夸。云树 绕堤沙,怒涛卷霜雪,天堑无涯。市列珠玑,户盈罗绮,竞豪奢。重湖叠清嘉,有三秋桂子,十里荷花。羌管弄晴,菱歌泛夜,嬉嬉钓叟莲娃。千骑拥高衙,乘醉听箫鼓,吟赏烟霞。异日图将好景,归去凤池夸。";
int num = str.length/LINENUM;
NSLog(@"%d",str.length);
NSLog(@"%d",num);
for (int i=0; i<=num; i++) {
UITextView* textview=[[UITextView alloc]init];
NSLog(@"%d-----",begin);
if(i==num)
partialString=[str substringWithRange:NSMakeRange(begin,str.length%LINENUM)];
else
partialString=[str substringWithRange:NSMakeRange(begin,LINENUM)];
textview.backgroundColor=[UIColor clearColor];
textview.text=partialString;
textview.frame=CGRectMake(0, 30+i*LINEHEIGHT, 200, 30);
[self.view addSubview:textview];
begin+=LINENUM;
NSLog(@"%@",partialString);
}