S sconcequence Member Licensed User Longtime User Oct 29, 2011 #1 This was mentioned on these forums before, but from a different perspective. Whenever I scroll my ScrollView down, the EditText nearest to the top of the screen gets focus. I simply need to ensure that this focus shift never happens or is diverted. Under the _FocusChanged Sub for the EditTexts, I put in: Code: Copy If HasFocus = True Then If usOddsText.Text = "" Then dummyEdit.Visible = True dummyEdit.RequestFocus p.HideKeyboard(Activity) dummyEdit.Visible = False End If End If Which isn't a perfect solution because it doesn't distinguish between actual focus changed based on clicking and the "auto focus" caused by the ScrollView, but this code does nothing anyway. Where do I put this focus diversion code so that the EditTexts lose their focus when the ScrollView gives them focus? Thanks. --
This was mentioned on these forums before, but from a different perspective. Whenever I scroll my ScrollView down, the EditText nearest to the top of the screen gets focus. I simply need to ensure that this focus shift never happens or is diverted. Under the _FocusChanged Sub for the EditTexts, I put in: Code: Copy If HasFocus = True Then If usOddsText.Text = "" Then dummyEdit.Visible = True dummyEdit.RequestFocus p.HideKeyboard(Activity) dummyEdit.Visible = False End If End If Which isn't a perfect solution because it doesn't distinguish between actual focus changed based on clicking and the "auto focus" caused by the ScrollView, but this code does nothing anyway. Where do I put this focus diversion code so that the EditTexts lose their focus when the ScrollView gives them focus? Thanks. --
Erel B4X founder Staff member Licensed User Longtime User Oct 30, 2011 #2 Can you post your project? Upvote 0
rbw152 Member Licensed User Longtime User May 1, 2014 #3 I get the same issue. I want to get focus if I click inside the edittext, but leave them alone when simply scrolling the scrollview. All controls (including the edittexts) are dynamically generated inside the scrollview. Any news on this? Upvote 0
I get the same issue. I want to get focus if I click inside the edittext, but leave them alone when simply scrolling the scrollview. All controls (including the edittexts) are dynamically generated inside the scrollview. Any news on this?
Erel B4X founder Staff member Licensed User Longtime User May 1, 2014 #4 Please start a new thread for this question. Upvote 0