小编Hel*_*rld的帖子

如何更改UIButton标题颜色?

我以编程方式创建一个按钮..........

button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self action:@selector(aMethod:)
forControlEvents:UIControlEventTouchDown];
[button setTitle:@"Show View" forState:UIControlStateNormal];
button.frame = CGRectMake(80.0, 210.0, 160.0, 40.0);
[view addSubview:button];
Run Code Online (Sandbox Code Playgroud)

如何更改标题颜色?

iphone objective-c uibutton ios

186
推荐指数
2
解决办法
16万
查看次数

Objective-C中的"无法识别的选择器发送到实例"错误

我创建了一个按钮,并为其添加了一个动作,但是一旦调用它,我就收到了这个错误:

-[NSCFDictionary numberButtonClick:]: unrecognized selector sent to instance
 0x3d03ac0 2010-03-16 22:23:58.811
 Money[8056:207] *** Terminating app
 due to uncaught exception
 'NSInvalidArgumentException', reason:'*** -[NSCFDictionary numberButtonClick:]:  unrecognized selector sent to instance 0x3d03ac0'
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
        UIButton *numberButton = [UIButton buttonWithType:UIButtonTypeCustom];        
        numberButton.frame = CGRectMake(10, 435, 46, 38);
        [numberButton setImage:[UIImage imageNamed:@"one.png"] forState:UIControlStateNormal];
        [numberButton addTarget:self action:@selector(numberButtonClick:) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubview: numberButton]; 
    }
return self;
}

-(IBAction)numberButtonClick:(id)sender{
    NSLog(@"---");
}
Run Code Online (Sandbox Code Playgroud)

objective-c selector unrecognized-selector

151
推荐指数
10
解决办法
39万
查看次数

无法更改UILabel文本颜色

我想更改UILabel文本颜色,但我无法更改颜色,这就是我的代码的样子.

UILabel *categoryTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 46, 16)];
categoryTitle.text = @"abc";
categoryTitle.backgroundColor = [UIColor clearColor];
categoryTitle.font = [UIFont systemFontOfSize:12];
categoryTitle.textAlignment = UITextAlignmentCenter;
categoryTitle.adjustsFontSizeToFitWidth = YES;
categoryTitle.textColor = [UIColor colorWithRed:188 green:149 blue:88 alpha:1.0];
[self.view addSubview:categoryTitle];
[categoryTitle release];
Run Code Online (Sandbox Code Playgroud)

标签文本颜色为白色,而不是我的自定义颜色.

感谢您的帮助.

objective-c uilabel uicolor

66
推荐指数
2
解决办法
11万
查看次数

我可以在MacOS上开发Android应用程序吗?

我想在Android上开发应用程序.SDK可以安装在Mac上吗?

macos android

63
推荐指数
6
解决办法
9万
查看次数

如何确定角色是否是汉字

如何确定角色是否是使用红宝石的中文角色?

ruby unicode encoding cjk character-properties

10
推荐指数
2
解决办法
4411
查看次数

Xcode启动时出错

当我打开 xocde 时,它​​会弹出一个窗口,并告诉我:

"xcode scanning for plug-ins failed.
You may not have appropriate permission to read or load installed plug-ins."
Run Code Online (Sandbox Code Playgroud)

我不知道该怎么办 ?

xcode

5
推荐指数
1
解决办法
1215
查看次数

0
推荐指数
1
解决办法
919
查看次数

我应该使用UIWebView或UITextView在电子书阅读器应用程序中显示文本吗?

我想制作一个电子书阅读器iPhone应用程序.我应该使用UITextView还是UIWebView显示文字?其他电子书阅读器使用哪种控件?

iphone cocoa-touch uiwebview uitextview

0
推荐指数
1
解决办法
2955
查看次数

为rails 3使用自定义JSON格式

在rails应用程序中,我有一个返回json字符串的操作.它看起来像这样:

if exist_user
    format.json { render json: {:msg => 'has this user'}}
else
Run Code Online (Sandbox Code Playgroud)

但是rails显示错误:参数太少

如何渲染自定义json字符串?

json ruby-on-rails

0
推荐指数
1
解决办法
3314
查看次数