High All
In an existing project I have moved a lot of views on to panels for ease of management. On one panel one of the views is an EditText created in the manifest to gain a decent cursor.
This EditText is only high enough to show one line. This has worked well when in the Activity but there is a problem when added to the Panel.
In the original as the user moves the cursor to the left, text scrolls to the right and out of sight, all looks good.
When the EditText is on the Panel, the text wraps forcing the top of the visible text to be cut off. Nothing of the second line is visible.
I have tried EditText.singleline = True/False and EditText.wrap = True/False in all combinations and nothing seems to change.
Below the two blocks of code and the code from the Manifest.
It is a small but annoying issue so any help is appreciated.
Regards Roger
In an existing project I have moved a lot of views on to panels for ease of management. On one panel one of the views is an EditText created in the manifest to gain a decent cursor.
This EditText is only high enough to show one line. This has worked well when in the Activity but there is a problem when added to the Panel.
In the original as the user moves the cursor to the left, text scrolls to the right and out of sight, all looks good.
When the EditText is on the Panel, the text wraps forcing the top of the visible text to be cut off. Nothing of the second line is visible.
I have tried EditText.singleline = True/False and EditText.wrap = True/False in all combinations and nothing seems to change.
Below the two blocks of code and the code from the Manifest.
Activity version:
Private xcursor As XmlLayoutBuilder
xcursor.LoadXmlLayout(Activity, "layout1")
Idisplay = xcursor.GetView("edittext1")
Idisplay.RemoveView
Activity.AddView(Idisplay, Rdisplay.Left, Rdisplay.Top + Rdisplay.Height, dmiddle.Width, Rdisplay.Height)
Idisplay.Left = Rdisplay.Left
Idisplay.Top = Rdisplay.Top + Rdisplay.Height
Idisplay.BringToFront
Panel version:
Private xcursor As XmlLayoutBuilder
xcursor.LoadXmlLayout(Activity, "layout1")
Idisplay = xcursor.GetView("edittext1")
Idisplay.RemoveView
PnlBASE.AddView(Idisplay, Rdisplay.Left, Rdisplay.Top + Rdisplay.Height, IDWidth, Rdisplay.Height)
Idisplay.Left = Rdisplay.Left
Idisplay.Top = Rdisplay.Top + Rdisplay.Height
'Idisplay.SingleLine = True
'Idisplay.Wrap = False
Manifest:
'Used to recreate IDisplay with decent cursor
CreateResource(layout, layout1.xml,
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:orientation="vertical" >
<EditText android:tag="EditText1" android:id="@+id/edittext1"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:textCursorDrawable="@drawable/my_custom_cursor_drawable"
/>
</LinearLayout>
)
It is a small but annoying issue so any help is appreciated.
Regards Roger