Touch Event Problem iOS

Hi guys,

Just having an issue with a touch/tap event on my button, when I tap or touch on the button I get no response, however if I use the touch and start off the button and drag my finger back onto it, it does respond.

From what I can gather so far, the issue is because of the button’s position at the top of the screen, the app is in portrait. If I move the button down it works, or if I put it on the bottom edge it is fine also… It is like there is an invisible bar or something up the top stopping the tap event getting through.

I’m wondering if anyone has discovered a solution to this problem?

Running Corona SDK version 935 and the latest Xcode…

PS: Leaving a big gap in the top of my app isn’t a solution :slight_smile:

Jessica Newton
Lead Developer - Rose Covenant [import]uid: 168562 topic_id: 32277 reply_id: 332277[/import]

Hi,

Could you provide some code for us, its hard to see whats creating this behavior.

Joakim [import]uid: 81188 topic_id: 32277 reply_id: 128414[/import]

Hello Jess,
Is this running on an iPhone5 by chance? I think I heard about some bug (currently being investigated) about something on the screen not being detected if it’s in the “outlying” regions of the screen on iPhone5. Maybe that’s not the issue, but it could be.

Brent [import]uid: 9747 topic_id: 32277 reply_id: 128440[/import]

Not iphone 5, just an iphone4. Havn’t tested it on android yet to see if theres a smiliar issue or not.

As for code sample

local menuShown = false;  
local dropListBG, btnNewList, btnRepeatList, btnSendList;  
  
local newList = display.newImageRect("image/Buttons/btnShopping.png", 136, 42, false)  
newList:setReferencePoint(display.TopLeftReferencePoint)  
newList.x, newList.y = 0, 0  
  
local function loadDropMenu()  
  
 if(menuShown == false) then  
 menuShown = true;  
 dropListBG = display.newImageRect("image/Backgrounds/dropListBG.png", 117, 122, false)  
 dropListBG:setReferencePoint(display.TopLeftReferencePoint)  
 dropListBG.x, dropListBG.y = 0, 41;  
 menuGroup:insert(dropListBG);  
  
 btnNewList = display.newImageRect("image/Buttons/btnNewList.png", 113, 44, false)  
 btnNewList:setReferencePoint(display.TopLeftReferencePoint)  
 btnNewList.x, btnNewList.y = 1, 40  
 menuGroup:insert(btnNewList);  
  
 btnRepeatList = display.newImageRect("image/Buttons/btnRepeatList.png", 113, 44, false)  
 btnRepeatList:setReferencePoint(display.TopLeftReferencePoint)  
 btnRepeatList.x, btnRepeatList.y = 1, 80  
 menuGroup:insert(btnRepeatList);  
  
 btnSendList = display.newImageRect("image/Buttons/btnSendList.png", 113, 44, false)  
 btnSendList:setReferencePoint(display.TopLeftReferencePoint)  
 btnSendList.x, btnSendList.y = 1, 120  
 menuGroup:insert(btnSendList);  
  
 btnNewList:addEventListener("touch", navigateNewList);  
 end  
 end  
  
newList:addEventListener("touch", loadDropMenu);  
  

If the initial button is say 50 or more pixels further down on the screen, the touch works as expected, but if it sits up in that little buffer then only drag over ‘touch’ events are detected.

So, logically it does sound as if there is a zone where touch events aren’t even being triggered. The pixel locations are still fine on touch events though because my dropdown menu code does recognize touches outside of it by pixel evaluation and there are no problems there (except once again still unresponsive on that top bar area), so… to me this sounds like a bug. [import]uid: 168562 topic_id: 32277 reply_id: 128487[/import]

This is just off the top of my head but the only thing that comes to mind is the iOS notification bar. It may be overriding anything in that small section just at the top of any app. It responds to drag, not touch. If you have an iOS 4.3 device it would be ideal to test the theory, it would not have the notification bar. [import]uid: 56820 topic_id: 32277 reply_id: 128494[/import]

You’re actually spot on anderoth, I was just testing other features of my app when I got a facebook message come in which was when I noticed that the exact size of the untouchable zone is the same as the size of the notification bar. Question now is… how to get around this, because when there isn’t a notification it shouldn’t be protecting that space… At least no other apps would.

I dislike all these workaround issues =/ [import]uid: 168562 topic_id: 32277 reply_id: 128507[/import]

Hi,

Could you provide some code for us, its hard to see whats creating this behavior.

Joakim [import]uid: 81188 topic_id: 32277 reply_id: 128414[/import]

Hi Jessica,
Is this in iOS6? It might be a new issue/bug introduced in that upgrade, because I have a Corona app running on an iOS5.x device, and I receive tap and touch events in the Notification Bar region. The only annoying this is that the little “tab” for the Notification Bar still slides down when I do a downward movement in that area… but I already asked Corona staff about this awhile back and it’s totally beyond their control, Apple is rigid about putting that thing up there.

Brent
[import]uid: 9747 topic_id: 32277 reply_id: 128544[/import]

Hi Brent,

Yeah it is iOS6, you’re probably right about it being the issue. Guess I just have to wait for a corona fix on it :confused: [import]uid: 168562 topic_id: 32277 reply_id: 128553[/import]

Hello Jess,
Is this running on an iPhone5 by chance? I think I heard about some bug (currently being investigated) about something on the screen not being detected if it’s in the “outlying” regions of the screen on iPhone5. Maybe that’s not the issue, but it could be.

Brent [import]uid: 9747 topic_id: 32277 reply_id: 128440[/import]

Hi Jessica,
If it’s a bug (and it sounds like it is), the fastest way to get it investigated is to create a quick code sample and submit a bug report. The sample code is essential and in this case it should be fairly easy to write. The Corona team is constantly busy, and while they investigate bugs frequently, they can’t be expected to write code blocks for every reported issue in a timely manner. So, if you can isolate your issue to separate code file and submit the report to the link below, that will vastly speed up its resolution in an upcoming build of Corona.

http://developer.coronalabs.com/content/bug-submission

Hope this helps!
Brent
[import]uid: 9747 topic_id: 32277 reply_id: 128555[/import]

Not iphone 5, just an iphone4. Havn’t tested it on android yet to see if theres a smiliar issue or not.

As for code sample

local menuShown = false;  
local dropListBG, btnNewList, btnRepeatList, btnSendList;  
  
local newList = display.newImageRect("image/Buttons/btnShopping.png", 136, 42, false)  
newList:setReferencePoint(display.TopLeftReferencePoint)  
newList.x, newList.y = 0, 0  
  
local function loadDropMenu()  
  
 if(menuShown == false) then  
 menuShown = true;  
 dropListBG = display.newImageRect("image/Backgrounds/dropListBG.png", 117, 122, false)  
 dropListBG:setReferencePoint(display.TopLeftReferencePoint)  
 dropListBG.x, dropListBG.y = 0, 41;  
 menuGroup:insert(dropListBG);  
  
 btnNewList = display.newImageRect("image/Buttons/btnNewList.png", 113, 44, false)  
 btnNewList:setReferencePoint(display.TopLeftReferencePoint)  
 btnNewList.x, btnNewList.y = 1, 40  
 menuGroup:insert(btnNewList);  
  
 btnRepeatList = display.newImageRect("image/Buttons/btnRepeatList.png", 113, 44, false)  
 btnRepeatList:setReferencePoint(display.TopLeftReferencePoint)  
 btnRepeatList.x, btnRepeatList.y = 1, 80  
 menuGroup:insert(btnRepeatList);  
  
 btnSendList = display.newImageRect("image/Buttons/btnSendList.png", 113, 44, false)  
 btnSendList:setReferencePoint(display.TopLeftReferencePoint)  
 btnSendList.x, btnSendList.y = 1, 120  
 menuGroup:insert(btnSendList);  
  
 btnNewList:addEventListener("touch", navigateNewList);  
 end  
 end  
  
newList:addEventListener("touch", loadDropMenu);  
  

If the initial button is say 50 or more pixels further down on the screen, the touch works as expected, but if it sits up in that little buffer then only drag over ‘touch’ events are detected.

So, logically it does sound as if there is a zone where touch events aren’t even being triggered. The pixel locations are still fine on touch events though because my dropdown menu code does recognize touches outside of it by pixel evaluation and there are no problems there (except once again still unresponsive on that top bar area), so… to me this sounds like a bug. [import]uid: 168562 topic_id: 32277 reply_id: 128487[/import]

This is just off the top of my head but the only thing that comes to mind is the iOS notification bar. It may be overriding anything in that small section just at the top of any app. It responds to drag, not touch. If you have an iOS 4.3 device it would be ideal to test the theory, it would not have the notification bar. [import]uid: 56820 topic_id: 32277 reply_id: 128494[/import]

You’re actually spot on anderoth, I was just testing other features of my app when I got a facebook message come in which was when I noticed that the exact size of the untouchable zone is the same as the size of the notification bar. Question now is… how to get around this, because when there isn’t a notification it shouldn’t be protecting that space… At least no other apps would.

I dislike all these workaround issues =/ [import]uid: 168562 topic_id: 32277 reply_id: 128507[/import]

Hi Jessica,
Is this in iOS6? It might be a new issue/bug introduced in that upgrade, because I have a Corona app running on an iOS5.x device, and I receive tap and touch events in the Notification Bar region. The only annoying this is that the little “tab” for the Notification Bar still slides down when I do a downward movement in that area… but I already asked Corona staff about this awhile back and it’s totally beyond their control, Apple is rigid about putting that thing up there.

Brent
[import]uid: 9747 topic_id: 32277 reply_id: 128544[/import]

Hi Brent,

Yeah it is iOS6, you’re probably right about it being the issue. Guess I just have to wait for a corona fix on it :confused: [import]uid: 168562 topic_id: 32277 reply_id: 128553[/import]

Hi Jessica,
If it’s a bug (and it sounds like it is), the fastest way to get it investigated is to create a quick code sample and submit a bug report. The sample code is essential and in this case it should be fairly easy to write. The Corona team is constantly busy, and while they investigate bugs frequently, they can’t be expected to write code blocks for every reported issue in a timely manner. So, if you can isolate your issue to separate code file and submit the report to the link below, that will vastly speed up its resolution in an upcoming build of Corona.

http://developer.coronalabs.com/content/bug-submission

Hope this helps!
Brent
[import]uid: 9747 topic_id: 32277 reply_id: 128555[/import]