Hello,
I am using Xamarin Forms to render an Editor that allows for multiline text. However, when I long press in the Editor box when it already has more than 1 line of text, the menu is not showing up to select/cut/copy the text. How do I enable this menu? It works if it's a single line of text.
I have already set this to true, so it should work but doesn't work. Control.EditText.SetTextIsSelectable
This is the code I have in the Android Project.
[assembly: ExportRenderer(typeof(CustomEditor), typeof(CustomEditorRenderer))]
namespace MyProject.Droid.MRenderers
{
public class CustomEditorRenderer : MaterialEditorRenderer
{
public CustomEditorRenderer(Context context) : base(context)
{
}
protected override void OnElementChanged(ElementChangedEventArgs<Editor> e)
{
base.OnElementChanged(e);
Control?.SetBackgroundColor(Android.Graphics.Color.Transparent);
if (Control != null)
{
//This is the HeightRequest
var ElementHeightRequest = Element.HeightRequest;
//Convert it to Pixels
var EditTextHeight= ConvertToPixels(ElementHeightRequest);
//Set the Control's EditText height
Control.EditText.SetHeight(200);
Control.EditText.SetTextIsSelectable(true);
Control.EditText.Background = null;
Control.EditText.SetBackgroundColor(Android.Graphics.Color.Transparent);
}
}