ios - Button in uiview not clickable -
pls help.. have button in subclass, when addsubview in uiview, cant clicked, idea?..thanks
the button in subclass:
- (void)configuredate{ changebutton=[uibutton buttonwithtype:uibuttontyperoundedrect]; changebutton.frame= cgrectmake(10, 20, 100, 30); [changebutton settitle:@"change date" forstate:uicontrolstatenormal]; [changebutton addtarget:self action:@selector(changedate) forcontrolevents:uicontroleventtouchupinside]; [self addsubview:changebutton]; }
i added subclass/button in uiview:
dateclass = [[dateclass alloc] init]; [dateclass configuredate]; [myview addsubview:dateclass]; [dateclass releasetable];
the button appears not clickable:(
try this:
[myview addsubview:dateclass]; [myview bringsubviewtofront:dateclass];
try setting bg color both dateclass , changebutton button test.
- (void)configuredate{ changebutton=[uibutton buttonwithtype:uibuttontyperoundedrect]; changebutton.frame= cgrectmake(10, 20, 100, 30); [changebutton settitle:@"change date" forstate:uicontrolstatenormal]; [changebutton addtarget:self action:@selector(changedate) forcontrolevents:uicontroleventtouchupinside]; [self addsubview:changebutton]; self.backgroundcolor=[uicolor redcolor]; changebutton.backgroundcolor=[uicolor yellowcolor]; }
Comments
Post a Comment