title: What causes Subviews in iOS to not capture touches?
body: <p>I'm developing in Xamarin Studio (MonoTouch), but the concept is the same.</p>
  
  <p>I have a UIViewController, and within that UIViewController I've added several subviews that each need to respond to tap events. I attach the UITapGestureRecognizer to my subviews, but they do not fire. Look at "AddExploreButton()" and "AddFollowingButton()".</p>
  
  <p>If I add the gestures to the containing View (MyMenu.View), it does capture the tap gestures, but I need the subviews to handle the events.</p>
  
  <p>What causes my subviews to NOT receive the gestures? (Note I've also set UserInteractionEnabled = true on practically everything).</p>
  
  <p>Secondly, if this is the incorrect coding pattern, how else would I hook up subviews to touch events?</p>
  
  <pre><code>public class MyMenu : UIViewController
  {
      private UIImageView _settingsButton;
      private TrendingMenuButton _trendingButton;
      private FollowingMenuButton _followingButton;
      private ExploreMenuButton _exploreButton;
      private NotificationsMenuButton _notificationsButton;
  
      public MyMenu() { }
  
      public override void ViewDidLoad() {
          base.ViewDidLoad();
  
          View.Hidden = true;
          View.UserInteractionEnabled = true;
          View.BackgroundColor = UIColor.FromPatternImage(UIImage.FromBundle("images/menu_bg.png"));
          View.Frame = new RectangleF(0, CityTitleBar.NAV_HEIGHT, 320, 349);
  
          AddSettingsButton();
          AddTrendingButton();
          AddFollowingButton();
          AddExploreButton();
          AddNotificationsButton();
      }
  
      private void AddSettingsButton() {
          _settingsButton = new UIImageView(UIImage.FromBundle("images/icon_cogwheel.png"));
          _settingsButton.Frame = new RectangleF(new PointF(269, 12), _settingsButton.Frame.Size);
          View.AddSubview(_settingsButton);
      }
  
      private void AddTrendingButton() {
          _trendingButton = new TrendingMenuButton(42, 33);
          View.AddSubview(_trendingButton);
      }
  
      private void AddFollowingButton() {
          _followingButton = new FollowingMenuButton(182, 33);
          _followingButton.AddGestureRecognizer(new UITapGestureRecognizer((g) =&gt; {
              MenuHelper.HideMenu();
              NavigationHelper.LoadScreen(new FavoritesScreen());
          }));
          View.AddSubview(_followingButton);
      }
  
      private void AddExploreButton() {
          _exploreButton = new ExploreMenuButton(42, 187);
          _exploreButton.AddGestureRecognizer(new UITapGestureRecognizer((g) =&gt; {
              MenuHelper.HideMenu();
              NavigationHelper.LoadScreen(new ExploreScreen());
          }));
          View.AddSubview(_exploreButton);
      }
  
      private void AddNotificationsButton() {
          _notificationsButton = new NotificationsMenuButton(182, 187);
          View.AddSubview(_notificationsButton);
      }
  }
  </code></pre>