iOS Question SelectionStart behaviour

Markos

Active Member
Licensed User
Longtime User
Hi All,

I was hoping Selectionstart in textview would behave like in edittext in b4a and position the cursor at the end of the string with with code 'textview1.selectionstart = textview1.text.length' and in a multiline scenario the cursor would scroll down the textview to the last character row.

I'm not getting that effect. Can you please confirm this is how the result will be for this enhanced method/property.

Thanks

Mark
 

Markos

Active Member
Licensed User
Longtime User
I'm using an iphone6 with ios 8 or 9. What happens is the text appends to the textview nicely but when it reaches the bottom it does not scroll up as I expect it should it just hides off the view unless I manually scroll the textview up then the scroll triggers upon each add.

I'm now trying your code which I know is not tested but will like to get the syntax right to stop animation with your help thanks. If I get it working the next step is to figure out why it needs a physcial touch for the scrolling to work at each button add to the textview content.

I'm attached the error saying method not valid
 

Attachments

  • scrollerr.jpg
    scrollerr.jpg
    221.1 KB · Views: 224
Upvote 0

Markos

Active Member
Licensed User
Longtime User
I'm using an iphone6 with ios 8 or 9. What happens is the text appends to the textview nicely but when it reaches the bottom it does not scroll up as I expect it should it just hides off the view unless I manually scroll the textview up then the scroll triggers upon each add.

I'm now trying your code which I know is not tested but will like to get the syntax right to stop animation with your help thanks. If I get it working the next step is to figure out why it needs a physcial touch for the scrolling to work at each button add to the textview content.

I'm attached the error saying method not valid
Ok Found the reason it was supposed to be setAnimationsEnabled (plural). Now the result is as follows:

1) When textview full and last line is at bottom it wont scroll unless I touch the textview and manually flick up however the scroll only works 3 or 4 times then it stops

2. Without using the setanimationsenabled the scroll continues to work with each add after the flick up of the textview.

If you do not experience this then it has to be some version related issue
 
Upvote 0

Markos

Active Member
Licensed User
Longtime User
Peculiar thing I messed with the height of the textview and once it is less than 320dip or 45%y the scrolling works flawlessly. Is there some property I can change via native mode or otherwise to allow this height to be greater?
 
Upvote 0

Markos

Active Member
Licensed User
Longtime User
Hi Erel

Please find attached two versions one working when the height of the textview is 48%y and not working once height is greater
 

Attachments

  • tvsample_notworking2.zip
    2.3 KB · Views: 182
  • tvsample_working2.zip
    2.3 KB · Views: 177
Upvote 0

Markos

Active Member
Licensed User
Longtime User
So the problem must be a version related issue as my compiled version shows dif behaviour. Maybe the OS?

Whats the recommended min software requirements for scrolling to work
 
Upvote 0

Markos

Active Member
Licensed User
Longtime User
Dear Erel

I found the cause. As published so many times online people having issues with Textview scroll not working as it should. I found that initialising the view at startup is the key problem. So I initiate the adding of the view in a manual event like a Button and the scrolling works like a charm. It makes a little more sense as some online feedback hints that the time to initialise is sensitive.

Thanks for wanting to help me resolve an issue which is not replicated on your test machines, very cool of you as always.

Cheers!

Mark
 
Upvote 0
Top