H hung Active Member Licensed User Longtime User Jun 30, 2012 #1 I have an edittext with multiple lines enabled but select Input Type=None. I have load te edittext with content of a text file and i could scroll the content up and down. But I cannot get the position of current cursor in the edittext and i don't know which event is triggered. Could anyone help? :sign0085:
I have an edittext with multiple lines enabled but select Input Type=None. I have load te edittext with content of a text file and i could scroll the content up and down. But I cannot get the position of current cursor in the edittext and i don't know which event is triggered. Could anyone help? :sign0085:
mc73 Well-Known Member Licensed User Longtime User Jun 30, 2012 #2 I think you can use a timer, and when you have a change in cursor position, show it. Cursor position is found by using the .selectionStart property of edittext. See the attached example. I'm no expert, surely there has to be a more ellegant and easy way to acomplish this. Attachments edittextselectiontypenone.zip edittextselectiontypenone.zip 6.8 KB · Views: 410 Upvote 0
I think you can use a timer, and when you have a change in cursor position, show it. Cursor position is found by using the .selectionStart property of edittext. See the attached example. I'm no expert, surely there has to be a more ellegant and easy way to acomplish this.
stevel05 Expert Licensed User Longtime User Jun 30, 2012 #3 If you type Sub in the ide, then press Space then Tab and select EditText, you can see the methods available. There is not an event that captures scroll. From my tests if you have inputtype = None, there is no visible cursor in the text. What are you trying to achieve? Upvote 0
If you type Sub in the ide, then press Space then Tab and select EditText, you can see the methods available. There is not an event that captures scroll. From my tests if you have inputtype = None, there is no visible cursor in the text. What are you trying to achieve?
H hung Active Member Licensed User Longtime User Jul 1, 2012 #4 stevel05 said: If you type Sub in the ide, then press Space then Tab and select EditText, you can see the methods available. There is not an event that captures scroll. From my tests if you have inputtype = None, there is no visible cursor in the text. What are you trying to achieve? Click to expand... I have a edittext with type NONE for showing content of a text file for reading. now i could show and scroll up and down. But then when orientation changed, the edittext jump back to first line. I want to keep current position of what is showing but don‘t know how. There is no event and not cursor position. selection start works but the keyboard prompt up and may update my content in edittext. no clue yet:-( Upvote 0
stevel05 said: If you type Sub in the ide, then press Space then Tab and select EditText, you can see the methods available. There is not an event that captures scroll. From my tests if you have inputtype = None, there is no visible cursor in the text. What are you trying to achieve? Click to expand... I have a edittext with type NONE for showing content of a text file for reading. now i could show and scroll up and down. But then when orientation changed, the edittext jump back to first line. I want to keep current position of what is showing but don‘t know how. There is no event and not cursor position. selection start works but the keyboard prompt up and may update my content in edittext. no clue yet:-(
H hung Active Member Licensed User Longtime User Jul 1, 2012 #5 mc73 said: I think you can use a timer, and when you have a change in cursor position, show it. Cursor position is found by using the .selectionStart property of edittext. See the attached example. I'm no expert, surely there has to be a more ellegant and easy way to acomplish this. Click to expand... Thanks. But i don‘t want to change anything in the edittext so I don’t TEXT so i guess selectionstart return nothing. Upvote 0
mc73 said: I think you can use a timer, and when you have a change in cursor position, show it. Cursor position is found by using the .selectionStart property of edittext. See the attached example. I'm no expert, surely there has to be a more ellegant and easy way to acomplish this. Click to expand... Thanks. But i don‘t want to change anything in the edittext so I don’t TEXT so i guess selectionstart return nothing.
mc73 Well-Known Member Licensed User Longtime User Jul 1, 2012 #6 hung said: Thanks. But i don‘t want to change anything in the edittext so I don’t TEXT so i guess selectionstart return nothing. Click to expand... If you test the small example I've uploaded, you will see that selectionstart returns the cursor position. No need to type something in, afterall this was the reason you orginally set inputType to none, isn't it? Upvote 0
hung said: Thanks. But i don‘t want to change anything in the edittext so I don’t TEXT so i guess selectionstart return nothing. Click to expand... If you test the small example I've uploaded, you will see that selectionstart returns the cursor position. No need to type something in, afterall this was the reason you orginally set inputType to none, isn't it?
H hung Active Member Licensed User Longtime User Jul 1, 2012 #7 mc73 said: If you test the small example I've uploaded, you will see that selectionstart returns the cursor position. No need to type something in, afterall this was the reason you orginally set inputType to none, isn't it? Click to expand... Yes you are right. I just got a chance to see your example. It works. Thanks. :icon_clap: Upvote 0
mc73 said: If you test the small example I've uploaded, you will see that selectionstart returns the cursor position. No need to type something in, afterall this was the reason you orginally set inputType to none, isn't it? Click to expand... Yes you are right. I just got a chance to see your example. It works. Thanks. :icon_clap: