How do I get the soft keyboard identifier in android
I'd like to get the soft keyboard identifier in android for the purpose of
determining the keyboard height. The end goal is that I want to reposition
a view on the screen vertically to be centered between the top of the
keyboard and the bottom of the status bar. I can get the status bar height
with the following code:
int statusBarHeight = 0;
int resourceId = Resources.GetIdentifier("status_bar_height", "dimen",
"android");
if(resourceId > 0) {
statusBarHeight = Resources.GetDimensionPixelSize(resourceId);
}
Can I get the height of the soft keyboard in a similar way? I am using
Xamarin because I am sharing a backend between my iOS app and Android app,
but the code seems to be pretty similar for Android. I am also creating my
views entirely in code which is what I prefer; so my question is how can I
get the keyboard height in code in order to position a view in code?
No comments:
Post a Comment