iPhone - UISegmentedControl segment width = 0? -
i have uisegmentedcontrol 3 segments , want change width of 1 segment 1 when user chooses segment. here code:
// uisegmentedcontrol created [segmentedcontrol addtarget:self action:@selector(changeit:) forcontrolevents:uicontroleventvaluechanged]; //... // , changeit method: - (void) changeit:(id)sender { // discover original width of segment 1, restore later uisegmentedcontrol *seg = (uisegmentedcontrol*)sender; cgfloat segwidth = [seg widthforsegmentatindex:1]; // @ point segwidth = 0 ????????????????? // note: seg not nil @ point. printing seg console shows // valid uisegmentedcontrol... }
any clues? thanks.
documentation says "the default value {0.0}, tells uisegmentedcontrol automatically size segment."
Comments
Post a Comment