robertwijas / UISS

UIAppearance Stylesheets
MIT License
1.23k stars 80 forks source link

UITextField background property doesn't work #41

Closed Mohamed3amer closed 10 years ago

Mohamed3amer commented 10 years ago

I need to change background of UITextField but doesn't work

"UITextField": { "background":"txtField1" }

robertwijas commented 10 years ago

The problem is that this property does not follow naming convention (should be called backgroundImage) and UISS image converter does not recognise the value. You can fix it with a simple category:


@interface UITextField (UISS)

- (void)setBackgroundImage:(UIImage *)image UI_APPEARANCE_SELECTOR;

@end

@implementation UITextField (UISS)

- (void)setBackgroundImage:(UIImage *)image {
    self.background = image;
}

@end