iOS Question [SOLVED] The last item of a TableView gets covered by the keyboard

semar

Active Member
Licensed User
Longtime User
Hi all,

I have a running example using a iTableview named myDictionary. When I edit an item of the list, the item scrolls gently up by using the code
B4X:
Dim tf As TextField = Sender
myDictionary.ScrollTo(0, tf.Tag, myDictionary.SCROLL_TOP)
where tf.Tag contains the index of the TextField where i clicked on.
In this way the keyboard does not cover the item being edited, and I can see the TextField - so far so good.
However, when I try to edit the last item of the TebleView, the table does not scroll up enough, and the edited TextField remains covered by the keyboard.
Is there a trick to force the tableview to scroll a bit more upwards ?

I've also tryed to add a new element at the end of the TableView when I edit the last item, because in this way the scrolling upwards would work - in fact the problem arises only on the very last item of the TableView - but when I add a new item to the TableView, and then I update the TableView with the command "myDictionary.ReloadAll", then the BeginEdit event of the TextField does not continue anymore.

I've attached the project file so you can test and see what I mean. Try to add three or more elements with the "New" button. Then try to edit the last element.
You will see that the keyboard will cover the TextField being edited.

Is there any workaround to circumnavigate this problem ?

Thanks in advance,
Sergio
 

Attachments

  • myDictionary.zip
    142 KB · Views: 207
  • beforeEditing.jpg
    beforeEditing.jpg
    393.3 KB · Views: 194
  • byEditing.jpg
    byEditing.jpg
    391.3 KB · Views: 206

semar

Active Member
Licensed User
Longtime User

Hello Erel,
sorry for the delay of my answer.

Your example worked like a charm, many thanks !

However, I had to set the min. iOS Version to 8 in order to get it to work - as set in your example. In comparision, the iTableView is more compatible with previous O.S. versions.
Anyway, I guess that the version 8 is largely distributed.

Again, many thanks for your support.

Take care,
Sergio
 
Upvote 0
Top