I need to increase the distance between the soft-keyboard and the editor in the UI. Currently, the keyboard overlaps the editor bottom part.
Screenshot adding below:
Is there any solution for this?
I need to increase the distance between the soft-keyboard and the editor in the UI. Currently, the keyboard overlaps the editor bottom part.
Screenshot adding below:
Is there any solution for this?
Try the below code it will be help you.
In Xamarin Android Project
public class MainActivity
{
protected override void OnCreate(Bundle savedInstanceState)
{
Window.SetSoftInputMode(Android.Views.SoftInput.AdjustUnspecified);
}
}
or in AndroidManifest.xml
<activity android:name=".myActivity"
android:label="@string/app_name"
android:screenOrientation="sensorPortrait"
android:windowSoftInputMode="adjustPan"/>
check the java code on given link- KeyboardSize
Xamarin forms: How to increase the distance between keyboard and editor
You could implement this feature by add paddingBottom property for your Edior
.
Here is an example, add the paddingBottom
property in your EditorRenderer
:
public class CustomEditorRenderer : EditorRenderer
{
public CustomEditorRenderer(Context context) : base(context)
{
}
protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.Editor> e)
{
base.OnElementChanged(e);
if (Control == null)
return;
//Control.Background = new ColorDrawable(Android.Graphics.Color.Transparent);
//Control.Background = null;
float scale = Context.Resources.DisplayMetrics.Density;
int dpAsPixels = (int)(50 * scale + 0.5f);
Control.SetPadding(0, 0, 0, dpAsPixels);
}
}
Effect: Original space, Custom space.