bryantm1122 Member Licensed User Feb 9, 2016 #1 Hello, I have a scrollView that needs to change height when focus is on editText fields. I've worked that part out, but when I test on different screen sizes, the scrollView's new height doesn't work on < 5" screens. I'm testing on a Note4 with a 5.7" screen and 560dpi. Also testing on an HTC One with a 4.7" screen and ~460dpi. Using this code from Erel's ActionBar tutorial as an example: is there a way to find out the screen size programmatically, so I can then resize the scrollView as needed? I've tried this: Code: Copy Sub CalculateHeight If 100%x >= 480dip Then Return 1500 'scroll.Height for 5" + screens Else Return 1200 ' scroll.Height for 4" + screens It doesn't work. If I understand Erel's code correctly, the 100%x is the width as it relates to the pixel density, and not the physical width of the screen. Not sure if I need the dpi or physical width. I appreciate any help with this, or advice to go in a different direction. Thanks!
Hello, I have a scrollView that needs to change height when focus is on editText fields. I've worked that part out, but when I test on different screen sizes, the scrollView's new height doesn't work on < 5" screens. I'm testing on a Note4 with a 5.7" screen and 560dpi. Also testing on an HTC One with a 4.7" screen and ~460dpi. Using this code from Erel's ActionBar tutorial as an example: is there a way to find out the screen size programmatically, so I can then resize the scrollView as needed? I've tried this: Code: Copy Sub CalculateHeight If 100%x >= 480dip Then Return 1500 'scroll.Height for 5" + screens Else Return 1200 ' scroll.Height for 4" + screens It doesn't work. If I understand Erel's code correctly, the 100%x is the width as it relates to the pixel density, and not the physical width of the screen. Not sure if I need the dpi or physical width. I appreciate any help with this, or advice to go in a different direction. Thanks!
Erel B4X founder Staff member Licensed User Longtime User Feb 10, 2016 #2 The correct code to handle keyboard changes is: https://www.b4x.com/android/forum/t...-keyboard-with-the-ime-library.14832/#content Upvote 0
The correct code to handle keyboard changes is: https://www.b4x.com/android/forum/t...-keyboard-with-the-ime-library.14832/#content
bryantm1122 Member Licensed User Feb 10, 2016 #3 Thanks Erel! You led me right back to where I started, but seeing it with fresh eyes made it click. I made a video to illustrate how using the IME HeightChanged event fixed this issue in my app: Upvote 0
Thanks Erel! You led me right back to where I started, but seeing it with fresh eyes made it click. I made a video to illustrate how using the IME HeightChanged event fixed this issue in my app: