Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EZFormRadioField UIPickerView background #46

Open
amcastror opened this issue Feb 6, 2014 · 2 comments
Open

EZFormRadioField UIPickerView background #46

amcastror opened this issue Feb 6, 2014 · 2 comments

Comments

@amcastror
Copy link

Hi,

The first time I use a EZFormRadioField the UIPickerView' background is completely transparent (like [uicolor clearColor]). If I close and open the view, I get the background correctly. I'm attaching an image to show the problem.

Thanks a lot!
captura de pantalla de simulador ios 06-02-2014 0 45 17

@jessedc
Copy link
Contributor

jessedc commented Feb 7, 2014

Off the top of my head I'm not sure. If you look at the EZFormDemo/ScrollView Form on iPad it has a EZFormRadioField, and when you activate it the background behind the picker view is grey. UIPickerView has no background colour by default. EZForm doesn't modify the background colour of anything either.

If you can post some basic code I may be able to help if it's EZForm.

@amcastror
Copy link
Author

@jessedc, sory for the delay, I was out of town. Here's some code behind what I'm doing (only for the first EZFormRadioField).

@interface CreateReportViewController () <EZFormDelegate>
//...
@property (weak, nonatomic) IBOutlet EZFormInputControl *report_proyect;
//...
@end

@implementation CreateReportViewController
- (void)awakeFromNib{
    [super awakeFromNib];

    _form = [[EZForm alloc] init];
    _form.inputAccessoryType = EZFormInputAccessoryTypeStandard;
    _form.delegate = self;

    //...
    EZFormRadioField *report_proyect = [[EZFormRadioField alloc] initWithKey:REPORT_KEY_PROYECT];

    //...
    [_form addFormField:report_proyect];
    //...
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    //...
    [[self.form formFieldForKey:REPORT_KEY_PROYECT] useLabel:self.report_proyect];
    EZFormRadioField *proyectField = [self.form formFieldForKey:REPORT_KEY_PROYECT];
    proyectField.inputView = [[UIPickerView alloc] initWithFrame:CGRectZero];
    __strong EZFormInputControl *proyectInputControl = self.report_proyect;
    proyectInputControl.tapToBecomeFirstResponder = YES;
    //...

    //configurationStrings -> array of NSString
    [[_form formFieldForKey:REPORT_KEY_PROYECT] setChoicesFromArray:[configurationStrings objectForKey:REPORT_FORM_PROYECTS]];
    [[_form formFieldForKey:REPORT_KEY_PROYECT] setValidationRequiresSelection:YES];
    [[_form formFieldForKey:REPORT_KEY_PROYECT] setValidationRestrictedToChoiceValues:YES];
    [[_form formFieldForKey:REPORT_KEY_PROYECT] setUnselected:@"Sleccionar"];
    [[_form formFieldForKey:REPORT_KEY_PROYECT] setFieldValue:_report.proyect.name];
}

That's all. Thanks a lot for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants