Grouper / FlatUIKit

A collection of awesome flat UI components for iOS.
MIT License
7.79k stars 947 forks source link

FUIButton without Xib #147

Open foryouforhappy opened 10 years ago

foryouforhappy commented 10 years ago

When I use FUIButton without Xib. eg: .head file @property(strong,nonatomic) FUIButton *btnLogin; .m file self.btnLogin = [FUIButton buttonWithType:UIButtonTypeSystem]; self.btnLogin.frame = CGRectMake(self.edtPwd.frame.origin.x, self.edtPwd.frame.origin.y + self.edtPwd.frame.size.height + 10, self.edtPwd.frame.size.width, self.edtPwd.frame.size.height); self.btnLogin.buttonColor = [UIColor redColor]; self.btnLogin.cornerRadius = 6.0f; [self.btnLogin setTitle:@"Login" forState:UIControlStateNormal]; [self.view addSubview:self.btnLogin]; // when it run at IOS6 , error info: [UIRoundedRectButton setButtonColor:]: unrecognized selector sent to instance //

it's OK in IOS7

ramki1979 commented 10 years ago

UIButtonTypeSystem -> is available only from iOS 7.

jamieomatthews commented 9 years ago

For FlatUIKit you probably want to be using UIButtonTypeCustom. I'm going to look into adding an initializer that sets this for you, as several people are having issues related to this