OGeek|极客世界-中国程序员成长平台

标题: ios - 设置 TextView 边框颜色 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 23:58
标题: ios - 设置 TextView 边框颜色

我想为我的 UITextView 边框设置银色。我试过这个:

theGroupTextLabel.layer.borderWidth = 3.5f;
    theGroupTextLabel.layer.borderColor = [[UIColor whiteColor] CGColor];

...但是在颜色选项中只有一些颜色,例如 whiteColor、BlackColor、Green...

如果我想要银子怎么办?



Best Answer-推荐答案


您需要为自定义颜色使用 RGB 值;

CGFloat nRed=128.0/255.0;
CGFloat nBlue=98.0/255.0;
CGFloat nGreen=53.0/255.0;
UIColor *myColor=[[UIColor alloc]initWithRed:nRed green:nBlue blue:nGreen alpha:1];

Choose RGB Values Here

R:193 G:205 B:205 附近的东西会接近银

关于ios - 设置 TextView 边框颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13960039/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4