iphone - Button does not respond to touches -
iphone - Button does not respond to touches -
in app there background on top of window:
uiimageview *mybg = [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"bg_large.png"]]; [window addsubview:mybg];
then button in top of background:
uibutton *infobutton = [[uibutton buttonwithtype:uibuttontypeinfolight] retain]; infobutton.frame = cgrectmake(280,420,20,20); [infobutton addtarget:self action:@selector(showinfopanel:) forcontrolevents:uicontroleventtouchupinside]; [window addsubview:infobutton]; [infobutton release];
then scrollview within navigation controller, added window on top:
navcontroller = [[uinavigationcontroller alloc] init]; navcontroller.viewcontrollers = [[nsarray arraywithobject:dashboardviewcontroller] retain]; [navcontroller setnavigationbarhidden:yes]; myscrollview.opaque=no; myscrollview.backgroundcolor = [uicolor clearcolor]; dashboardviewcontroller.view.backgroundcolor = [uicolor clearcolor]; [window addsubview:navcontroller.view];
the scrollview respond touches should, infobutton added before in top of background doesn't. added infobutton top of bg, stable , not scroll scrollview.
how can create button respond touches, scrollview it?
u adding uinavigationcontroller.view on top of button thats why not respoiding, seek placing code [window addsubview:infobutton]; after [window addsubview:navcontroller.view];.
iphone cocoa-touch button
Comments
Post a Comment