It was perfectly showing the keyboard when I tap the text box on the screen till I added remote control feature to my application.
The remote controller is become first responder now. It is located in the very first viewcontroller of the application. The next viewcontrollers contain textboxes. When I tap and I want to see the keyboard.
How can I keep all chains of the responses to keep both remote controller working and textbox keyboards appearing at right time when I tap on the text box.
WhatToDo.cs contains remote control handler and BrowseApi.cs contains keyboards.
WhatToDo.cs
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
UIApplication.SharedApplication.SetStatusBarHidden (true, UIStatusBarAnimation.Fade);
-
if (audioSession == null) {
audioSession = AVAudioSession.SharedInstance ();
NSError error;
audioSession.SetCategory (AVAudioSession.CategoryPlayback, out error);
audioSession.SetActive (true, out error);
//AudioSession.Initialize(null, NSRunLoop.NSDefaultRunLoopMode);
//AudioSession.AudioRouteChanged += AudioSession_AudioRouteChanged;
AudioSession.Initialize (null, NSRunLoop.NSDefaultRunLoopMode);
AudioSession.AudioRouteChanged += AudioSession_AudioRouteChanged;
UIApplication.SharedApplication.BeginReceivingRemoteControlEvents ();
this.BecomeFirstResponder ();
}
// Perform any additional setup after loading the view, typically from a nib.
}
public override void ViewDidAppear (bool animated)
{
base.ViewDidAppear (animated);
}
public override void DidReceiveMemoryWarning ()
{
// Releases the view if it doesn't have a superview.
base.DidReceiveMemoryWarning ();
// Release any cached data, images, etc that aren't in use.
}
public override void ViewDidUnload ()
{
base.ViewDidUnload ();
// Clear any references to subviews of the main view in order to
// allow the Garbage Collector to collect them sooner.
//
// e.g. myOutlet.Dispose (); myOutlet = null;
ReleaseDesignerOutlets ();
}
public override bool CanBecomeFirstResponder {
get {
return true;
}
}
public override bool CanResignFirstResponder {
get {
return false;
}
}
/// <summary>
/// Kulaklıkk cıkınca girince buraya ugrar.
/// </summary>
/// <param name="sender">Sender.</param>
/// <param name="e">E.</param>
void AudioSession_AudioRouteChanged (object sender, AudioSessionRouteChangeEventArgs e)
{
}
public override void RemoteControlReceived (UIEvent theEvent)
{
}
BrowseApi.cs
public override void ViewDidLoad ()
{
textBoxSearchBrowseApi.Text = QueryStr;
base.ViewDidLoad ();
this.textBoxSearchBrowseApi.ShouldReturn = delegate(UITextField textField) {
this.textBoxSearchBrowseApi.BecomeFirstResponder ();
return true;
};
// make 'return' on last text field save and close the form
this.textBoxSearchBrowseApi.ShouldReturn = delegate(UITextField textField) {
this.textBoxSearchBrowseApi.ResignFirstResponder ();
searchQuery(textBoxSearchBrowseApi.Text);
return true;
};
}