Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Placeholder focus issue in xamarin.forms

$
0
0

Hello,
I'm using editor control in my app, and to set a placeholder in it i'm using following code to show /hide place holder on focused and unfocused event.

Focused += (object sender, FocusEventArgs e) => {
if(Text == Placeholder)
{
Text = "";
}
};

Unfocused += (object sender, FocusEventArgs e) => {
MyEditor obj = (MyEditor) sender;
if(string.IsNullOrEmpty(Text) || string.IsNullOrWhiteSpace(Text))
{
obj.Text = Placeholder;
}
};

Now the problem here is, in android devices user have to click 2 times on editor to open keyboard.

And if I remove the Text = "" statement then it's working properly.

Can any one tell me how can I solve this issue.
};


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>