Android Question xCustomListView and EditText keyboard

red30

Well-Known Member
Licensed User
Longtime User
CustomListView contains many EditText. If I scroll down and push the lowest EditText, it moves up and its place is occupied by a keyboard. It works well. But if I scrap and unwrap the app, the keyboard is viewed above the EditText (EditText doesnt move up). Why? How to fix it?
 
Last edited:

red30

Well-Known Member
Licensed User
Longtime User
I do not understand, can you give an example for my code?
B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Type ItemValue1 (Lanel1 As Label, EditText1 As EditText)
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private CLV As CustomListView
    Private Label1 As Label
    Private EditText1 As EditText
    'Private temp As List
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("main")
    For i=1 To 20
        Dim iv1 As ItemValue1
        iv1.Initialize
        CLV.Add(CreateItem1(iv1,"test "&i),iv1)
    Next
End Sub

Private Sub CreateItem1 (iv1 As ItemValue1, str As String) As B4XView
    Dim p As Panel
    p.Initialize("")
    p.SetLayoutAnimated(0,0,0,100%x,20%y)
    p.LoadLayout("card")
    Label1.Text=str
    Return p
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
Is that all right?
B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Type ItemValue1 (Lanel1 As Label, EditText1 As EditText)
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.
    Dim IME As IME
    Private CLV As CustomListView
    Private Label1 As Label
    Private EditText1 As EditText
    'Private temp As List
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("main")
    IME.Initialize("IME")
    IME.AddHeightChangedEvent
    For i=1 To 20
        Dim iv1 As ItemValue1
        iv1.Initialize
        CLV.Add(CreateItem1(iv1,"test "&i),iv1)
    Next
End Sub

Private Sub CreateItem1 (iv1 As ItemValue1, str As String) As B4XView
    Dim p As Panel
    p.Initialize("")
    p.SetLayoutAnimated(0,0,0,100%x,20%y)
    p.LoadLayout("card")
    Label1.Text=str
    Return p
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub IME_HeightChanged(NewHeight As Int, OldHeight As Int)
    CLV.GetBase.SetLayoutAnimated(0,0,0,100%x,NewHeight)
    CLV.Base_Resize (CLV.GetBase.Width, CLV.GetBase.Height)
End Sub
 
Last edited:
Upvote 0
Top