I am trying to show UIAlertView on Tap or Click of UITextField for both IPad and IPhone. I make an IBAction and Attach it with Tap Down event of UITextField.
But its not working correctly, means not always, in case of iphone and not working in-case of iPad
- (IBAction) TopuchState { //function code }
please help How could I do this.
UITextView supports the display of text using custom style information and also supports text editing. You typically use a text view to display multiple lines of text, such as when displaying the body of a large text document.
As you are already subscribed to be UITextField delegate, implement this method:
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"Alert Message" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil]; [alert show]; return YES; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With