• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Textfield in navigation controller not responding to user taps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Textfield in navigation controller not responding to user taps


  • Subject: Textfield in navigation controller not responding to user taps
  • From: Symadept <email@hidden>
  • Date: Mon, 04 Apr 2011 16:25:47 +0800

Hi,

I am having a strange problem in implementing UITextField as a part of
leftBarItem of NavigationController.

my leftBarItem customview, UIView has UIButton and UITextFields as subViews.


{
        UIButton *theButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [theButton setImage:[UIImage imageNamed:@"button.png"]
forState:UIControlStateNormal];
        [theButton setImageEdgeInsets:UIEdgeInsetsMake(0.0f, 6.0f, 0.0f,
0.0f)];

        theButton.frame = CGRectMake(26+15.0f, 0.0f, 26.0f, 20.0f);

        [theButton addTarget:self action:@selector(buttonClicked:)
forControlEvents:UIControlEventTouchUpInside];
        theButton.tag = eOVSBItemButton;

    }

    CustomSearchBar *searchBar = [[CustomSearchBar alloc] init];
    searchBar.tag = eOVSBSearchBar;
    searchBar.delegate = self;
    searchBar.frame = CGRectMake(26+15+26+15.0f, -5.0f, 134, 26.0f);
    [leftButtonView addSubview:searchBar];
    [searchBar release];

    UIBarButtonItem *leftBarButton = [[UIBarButtonItem alloc]
initWithCustomView:leftButtonView];
rootNavController.navigationBar.topItem.leftBarButtonItem = leftBarButton;

Button responds properly but on Tap SearchBar wont gets activated. If I
implement the same searchbar in anyother view, on tap cursor starts
blinking. What am I missing here?

Regards
symadept
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Book for expert programmer about cocoa and Objective-C
  • Next by Date: [MEET] Toronto Cocoaheads / tacow - April 12
  • Previous by thread: Re: NSStatusBar
  • Next by thread: [MEET] Toronto Cocoaheads / tacow - April 12
  • Index(es):
    • Date
    • Thread