iOS —label自动换行

    xiaoxiao2021-04-12  30

    UILabel *label = [[UILabel alloc]initWithFrame:frame];     label.text = tileName;     //背景颜色为红色     label.backgroundColor = [UIColor redColor];     //设置字体颜色为白色     label.textColor = [UIColor whiteColor];     //文字居中显示     label.textAlignment = UITextAlignmentCenter;     //自动折行设置     label.lineBreakMode = UILineBreakModeWordWrap;     label.numberOfLines = 0;     [self.collectionView addSubview:label];  
    转载请注明原文地址: https://ju.6miu.com/read-667461.html

    最新回复(0)