TheRealMatze Active Member Licensed User Dec 28, 2021 #1 Hello again! I see one more problem, but this time in the ui itself. Under b4a pages are scrolling up when the keyboard is visible, under b4i it looks like i have to do it by myself. I have created a new layout only containing a ScrollView and changed the "loadLayout" this way B4X: Copy 'Root.LoadLayout("editFarm") Root.LoadLayout("scroller") '< only contains a scrollView named "scroller" scroller.Panel.LoadLayout("editFarm") '< contains a panel named "scrollPanel" and inside a bounch of textboxes scroller.ContentWidth =100%x scroller.ContentHeight=scrollPanel.height The content - text-fields and a combo-box - fits to the page, so there is nothing to scroll as long as the keyboard is hidden. But when the Keyboard is visible nothing changes... So the keyboard covers the textfield. That means - i havn´t understand the scrollview correct... When i add a fictive value to the height (scroller.ContentHeight=scrollPanel.height + 300) the page is scrollable, but not only when the keyboard is visible. Instead of any fixed value i need a trigger that the keyboard is shown and the height of it, correct? And also a method to bring the textview into view i think... Can anybody tell me what is missing? Regards Matthias
Hello again! I see one more problem, but this time in the ui itself. Under b4a pages are scrolling up when the keyboard is visible, under b4i it looks like i have to do it by myself. I have created a new layout only containing a ScrollView and changed the "loadLayout" this way B4X: Copy 'Root.LoadLayout("editFarm") Root.LoadLayout("scroller") '< only contains a scrollView named "scroller" scroller.Panel.LoadLayout("editFarm") '< contains a panel named "scrollPanel" and inside a bounch of textboxes scroller.ContentWidth =100%x scroller.ContentHeight=scrollPanel.height The content - text-fields and a combo-box - fits to the page, so there is nothing to scroll as long as the keyboard is hidden. But when the Keyboard is visible nothing changes... So the keyboard covers the textfield. That means - i havn´t understand the scrollview correct... When i add a fictive value to the height (scroller.ContentHeight=scrollPanel.height + 300) the page is scrollable, but not only when the keyboard is visible. Instead of any fixed value i need a trigger that the keyboard is shown and the height of it, correct? And also a method to bring the textview into view i think... Can anybody tell me what is missing? Regards Matthias
Erel B4X founder Staff member Licensed User Longtime User Dec 28, 2021 #2 This is the best option: https://www.b4x.com/android/forum/threads/b4x-b4xpages-customlistview-keyboard-handling.131078/ Another option: https://www.b4x.com/android/forum/threads/calcrelativekeyboardheight-example.64054/#content Upvote 0
This is the best option: https://www.b4x.com/android/forum/threads/b4x-b4xpages-customlistview-keyboard-handling.131078/ Another option: https://www.b4x.com/android/forum/threads/calcrelativekeyboardheight-example.64054/#content
TheRealMatze Active Member Licensed User Dec 29, 2021 #3 Thanks Erel, i´ve tried to adopt the first option. editFarmScroll has the header and the ScrollView "scroller", editFarmElements the input-fields (located in panel1). B4X: Copy Private Sub B4XPage_Appear Root.LoadLayout("editFarmScroll") scroller.Panel.LoadLayout("editFarmElements") scroller.Height=Root.height-scroller.top #if b4a scroller.Panel.Height=(Panel1.Height) - (scroller.Height/2) #end if #if b4i scroller.ContentWidth =100%x scroller.ContentHeight=Panel1.Height + 50dip #end if End Sub B4X: Copy #if b4a Private Sub IME_HeightChanged (NewHeight As Int, OldHeight As Int) Dim KeyboardHeight As Int = Root.Height - NewHeight scroller.Height=Root.height - scroller.top - KeyboardHeight End Sub #end if B4X: Copy #if b4i Private Sub B4XPage_KeyboardStateChanged (Height As Float) If Height>0 Then Height=Height + 20 scroller.Height=Root.height - scroller.top - Height End Sub #end if Both android and ios-version looking good now. Did I miss anything important? Regards Matthias Upvote 0
Thanks Erel, i´ve tried to adopt the first option. editFarmScroll has the header and the ScrollView "scroller", editFarmElements the input-fields (located in panel1). B4X: Copy Private Sub B4XPage_Appear Root.LoadLayout("editFarmScroll") scroller.Panel.LoadLayout("editFarmElements") scroller.Height=Root.height-scroller.top #if b4a scroller.Panel.Height=(Panel1.Height) - (scroller.Height/2) #end if #if b4i scroller.ContentWidth =100%x scroller.ContentHeight=Panel1.Height + 50dip #end if End Sub B4X: Copy #if b4a Private Sub IME_HeightChanged (NewHeight As Int, OldHeight As Int) Dim KeyboardHeight As Int = Root.Height - NewHeight scroller.Height=Root.height - scroller.top - KeyboardHeight End Sub #end if B4X: Copy #if b4i Private Sub B4XPage_KeyboardStateChanged (Height As Float) If Height>0 Then Height=Height + 20 scroller.Height=Root.height - scroller.top - Height End Sub #end if Both android and ios-version looking good now. Did I miss anything important? Regards Matthias