Click here to Skip to main content
15,890,690 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
This code works fine if enter the value in text field and edit it using stepper
Basically it takes stepper values to give uicolor
I can't figure out to take text field values at the end to give colour to the view
Because when user types values and does not edit through stepper the user should get the answer
Please Help?
Java
-(void)textFieldDidEndEditing:(UITextField *)textField
{
    stp1.value=[txt1.text intValue];
    stp2.value=[txt2.text intValue];
    stp3.value=[txt3.text intValue];
}
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return NO;
}
-(IBAction)stpr
{
        red1=(int)stp1.value;
        txt1.text=[NSString stringWithFormat:@"%d",(int)red1];
        green1=(int)stp2.value;
        txt2.text=[NSString stringWithFormat:@"%d",(int)green1];
        blue1=(int)stp3.value;
        txt3.text=[NSString stringWithFormat:@"%d",(int)blue1];
}
-(IBAction)btnPressed
{
    
    view1.backgroundColor=[UIColor colorWithRed:red1/255 green:green1/255 blue:blue1/255 alpha:1.0];
}
Posted
Updated 16-Jun-15 10:19am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900