I currently have UIControl which has several subzones (image, label).
Unfortunately, when I use addTarget etc. It does not detect touches in subzones.
[myCustomView addTarget:self action:@selector(touchedView:) forControlEvents:UIControlEventTouchUpInside];
Is it possible for UIControl to detect touches on the subzones or should I approach it differently.
Just note that all UIControl routines that should not receive touch events themselves should have a userInteractionEnabled value of NO , not YES (this is the default value).
Therefore, you must set this on all labels, images, etc.
:)
.
myCustomView .
[myCustomView setUserInteractionEnabled:YES];
Source: https://habr.com/ru/post/1744276/More articles:How to get a link to the latest version of MS Excel in VB.net application? - .netInteresting SQL collation problem - sqlОтслеживать репо GitHub в филиале - gitМогу ли я и как отключить всплывающее окно при наведении мыши/над значком "плюс (+)" в Eclipse? - javaIncremental number in a string - pythonUitextfield cursor location - objective-cHelp translating from assembly to C - cJavaScript / HTML: How to display an IMG with a given size, and if the image is larger or larger than this size to crop / hide the overflow? - javascriptFractal image compression algorithm (and source code) - mathSend stdin to a process from a windows command prompt - windowsAll Articles