IOS开发中使用UIFont设置字体及批量创建控件

2020-01-14 22:12:16王冬梅

}

}

// 使用for循环给72个label的字体设置各种字体格式

for (int i=0; i<72; i++) {

UILabel *lab = [labarr objectAtIndex:i];

NSString *fontstring = [fontarray objectAtIndex:i];

lab.font = [UIFont fontWithName:fontstring size:18];

[self.view addSubview:[labarr objectAtIndex:i]];

}

}

- (void)didReceiveMemoryWarning {

[super didReceiveMemoryWarning];

// Dispose of any resources that can be recreated.

}

@end

以上就是本文的全部内容,希望对大家的学习有所帮助。


注:相关教程知识阅读请移步到IOS开发频道。