大佬教程收集整理的这篇文章主要介绍了objective-c – NSTextField颜色问题,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
//Create rectangle to size text field NSRect textFieldRect = NsmakeRect(300,300,54); //Instantiate text field and set defaults NSTextField* textField = [[NSTextField alloc] initWithFrame:textFieldRect]; [textField setFont:[NSFont fontWithName:@"Arial" size:48]]; [textField setTextColor:[NSColor whiteColor]]; [textField setstringvalue:@"Some Text"]; [textField setBACkgroundColor:[NSColor blackColor]]; [textField setDrawsBACkground:YES]; [textField setBordered:NO]; [[window contentView] addSubview:textField];
- (void)applicationDidFinishLaunching:(Nsnotification *)aNotification { NSRect textFieldRect = NsmakeRect(300,54); NSTextField* textField = [[NSTextField alloc] initWithFrame:textFieldRect]; [textField setFont:[NSFont fontWithName:@"Arial" size:48]]; [textField setTextColor:[NSColor whiteColor]]; [textField setstringvalue:@"Some Text"]; [textField setBACkgroundColor:[NSColor blackColor]]; [textField setDrawsBACkground:YES]; [textField setBordered:NO]; [[window contentView] addSubview:textField]; }@H_502_8@这就是结果 @H_502_8@alt text http://www.freeimagehosting.net/uploads/26c04b6b64.png
@H_502_8@我看不到任何白盒子.也许你正在使用不同的操作系统.或者也许你有一些其他的观点,相互引起你正在谈论的奇怪的影响.
以上是大佬教程为你收集整理的objective-c – NSTextField颜色问题全部内容,希望文章能够帮你解决objective-c – NSTextField颜色问题所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。