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

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -