我正在尝试更改按钮的视觉方面,但是我正在尝试使用 FlatUIKit 的按钮方面,对于那些不知道那没关系的人来说没关系,在他们提供的示例项目中更改 IBOutlet 按钮的颜色,但是它与 IBAction 的工作方式不同,这是他们的示例代码:
#import "ViewController.h"
#import "FUIButton.h"
#import "UIColor+FlatUI.h"
@interface ViewController ()
@property (weak, nonatomic) IBOutlet FUIButton *alertViewButton;
//as you can see its a FUIButton, and I'm not sure how to use that with an IBAction
@end
@implementation ViewController
- (void)viewDidLoad
{
self.alertViewButton.buttonColor = [UIColor peterRiverColor];
self.alertViewButton.shadowColor = [UIColor silverColor];
self.alertViewButton.shadowHeight = 3.0f;
self.alertViewButton.cornerRadius = 6.0f;
self.alertViewButton.titleLabel.font = [UIFont boldFlatFontOfSize:16];
[self.alertViewButton setTitleColor:[UIColor cloudsColor] forState:UIControlStateNormal];
[self.alertViewButton setTitleColor:[UIColor cloudsColor] forState:UIControlStateHighlighted];
}
到目前为止,这是我的代码:
我的.h
#import <UIKit/UIKit.h>
@interface HomeViewController : UIViewController {
}
- (IBAction)start:(id)sender;
@end
我的.m:
#import "HomeViewController.h"
#import "UIColor+FlatUI.h"
#import "FUIButton.h"
@interface HomeViewController ()
@end
@implementation HomeViewController
- (IBAction)start:(id)sender {
//this is the button i want change the appearance of.
}
我被这个困住了,我想使用 FUIButton 颜色效果的按钮是名为 start 的 IBAction,有帮助吗?提前致谢。
注意:如果有区别,我正在使用情节提要。