Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 UIWebview 中,我加载了一个背景颜色为#CBCDCF 的 html 页面。在之前的ViewController中(在这个ViewController中我没有使用UIWebview),我想将背景颜色设置为相同的值:#CBCDCF。我该怎么做?
你可以使用这样的宏
#define HEXCOLOR(c) [UIColor colorWithRed:((c>>24)&0xFF)/255.0 \ green:((c>>16)&0xFF)/255.0 \ blue:((c>>8)&0xFF)/255.0 \ alpha:1.0]
你可以这样做:
[yourViewController setBackgroundColor:HEXCOLOR(0xCBCDCF)]