After not finding an answer I have to again ask you all for help. I am creating a UIStepper
programatically but it will not display. Labels, buttons, and switches are all displaying properly so I must be missing something related to the stepper.
Elsewhere in my code I declare and initialize UIView *v
and NSMutableArray *steppers
, and declare UIStepper *st
. The code to create the stepper is:
st = [[UIStepper alloc] init];
st.frame = CGRectMake(xnear, ypos, 0, 0);
[st addTarget:self action:@selector(stepper1:) forControlEvents:UIControlEventValueChanged];
[st setMinimumValue:0];
[st setMaximumValue:99];
[st setWraps:NO];
[st setContinuous:NO];
[v addSubview:st];
[steppers addObject:st];
At runtime xnear = 100
and ypos = 250
, so the stepper is within the display. A label immediately above, and a text field immediately below, are displaying. Other questions regarding the UIStepper
state the width and height are ignored, so I used 0 for both. Is there anything obviously wrong with this code?
You are setting height and width of UIStepper as 0
give some height and width