UILbale自动换行

UIView *footerView = [[UIView alloc] initWithFrame:CGRectMake(10, 100, 300, 180)];  
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 100, 300, 150)];  
    label.text = @"where are you? where are you? where are you? where are you? where are you? where are you? where are you? where are you? where are you? where are you?";  
    //清空背景颜色  
    label.backgroundColor = [UIColor clearColor];  
    //设置字体颜色为白色  
    label.textColor = [UIColor whiteColor];  
    //文字居中显示  
    label.textAlignment = UITextAlignmentCenter;  
    //自动折行设置  
    label.lineBreakMode = UILineBreakModeWordWrap;  
    label.numberOfLines = 0;  

 

posted @ 2013-10-16 16:31  时光独白  阅读(275)  评论(0编辑  收藏  举报