A Andras Active Member Licensed User Longtime User Feb 17, 2012 #1 Is there any way to change the inner height parameter of a scroll view programatically? I'm looking to set an appropriate height for the number of items to be displayed at any particular time, but don't see how. Thanks all for help! John
Is there any way to change the inner height parameter of a scroll view programatically? I'm looking to set an appropriate height for the number of items to be displayed at any particular time, but don't see how. Thanks all for help! John
thedesolatesoul Expert Licensed User Longtime User Feb 17, 2012 #2 Scrollview.Panel.Height Sent from my GT-I9000 using Tapatalk Upvote 0
klaus Expert Licensed User Longtime User Feb 17, 2012 #3 ScrollView1.Panel.Height = xx Best regards. Upvote 0
walterf25 Expert Licensed User Longtime User Feb 17, 2012 #4 Scrollview inner height Andras said: Is there any way to change the inner height parameter of a scroll view programatically? I'm looking to set an appropriate height for the number of items to be displayed at any particular time, but don't see how. Thanks all for help! John Click to expand... You need to do it like this Code: Copy ScrollView1.Panel.Height = 100dip 'whatever height you want to give it Upvote 0
Scrollview inner height Andras said: Is there any way to change the inner height parameter of a scroll view programatically? I'm looking to set an appropriate height for the number of items to be displayed at any particular time, but don't see how. Thanks all for help! John Click to expand... You need to do it like this Code: Copy ScrollView1.Panel.Height = 100dip 'whatever height you want to give it
A Andras Active Member Licensed User Longtime User Feb 18, 2012 #5 Thanks - I'd been looking for an InnerHeight parameter! All clear now! John Upvote 0
D diego Member Licensed User Longtime User Feb 7, 2014 #6 Hi, is it correct this sentence? ScrollView1.Panel.Height = 100%y thanks Upvote 0
klaus Expert Licensed User Longtime User Feb 7, 2014 #7 Hi, is it correct this sentence? ScrollView1.Panel.Height = 100%y Click to expand... No ! The inner height of a ScrollView must be the height occupied by the views on this panel. Upvote 0
Hi, is it correct this sentence? ScrollView1.Panel.Height = 100%y Click to expand... No ! The inner height of a ScrollView must be the height occupied by the views on this panel.
D diego Member Licensed User Longtime User Feb 7, 2014 #8 Ok. I'm having problems with different device's resolution. If I set InnerHeight to 1000 and the resolution is 1800, the screen is cut. is there any way to calculate the heigth according to the device resolution? Last edited: Feb 7, 2014 Upvote 0
Ok. I'm having problems with different device's resolution. If I set InnerHeight to 1000 and the resolution is 1800, the screen is cut. is there any way to calculate the heigth according to the device resolution?
D diego Member Licensed User Longtime User Feb 7, 2014 #10 I'm using Designer, where you have to put a number in InnerHeight, I supposse this number is pixels, not dip. So, I must add a line to the source like "ScrollView1.Panel.Height = 1000dip" ? Upvote 0
I'm using Designer, where you have to put a number in InnerHeight, I supposse this number is pixels, not dip. So, I must add a line to the source like "ScrollView1.Panel.Height = 1000dip" ?
eps Expert Licensed User Longtime User Feb 7, 2014 #11 Ah, in that case have you autoscaled? Upvote 0
klaus Expert Licensed User Longtime User Feb 7, 2014 #12 As I told you in post #7, the inner height must be adapted to the height occupied by the views in the ScrollView. What kind of views do you have in the ScrollView ? How do you fill the ScrollView ? Upvote 0
As I told you in post #7, the inner height must be adapted to the height occupied by the views in the ScrollView. What kind of views do you have in the ScrollView ? How do you fill the ScrollView ?
D diego Member Licensed User Longtime User Feb 8, 2014 #13 I think now I got it. I have a TabHost, in one tab I put a scrollview. In another layout I have the views, filled by using %y in the Designer script. I want to fill the whole screen but I don't know the resolution. then, before loading the layout to the scrollview, setting Scrollview.Panel.Height to 95%y (because tabhost occupies a part of the screen) it fits OK. So, why use a TabHost? because I want to see similar size of views when you rotate the screen, forcing that horizontally has the same height as vertically. Finally, I use this: Code: Copy If Activity.Height > Activity.Width Then ScrollView1.Panel.Height = 95%y Else ScrollView1.Panel.Height = 95%x End If I'm sure there is a better way to do this, but it seems to work. Upvote 0
I think now I got it. I have a TabHost, in one tab I put a scrollview. In another layout I have the views, filled by using %y in the Designer script. I want to fill the whole screen but I don't know the resolution. then, before loading the layout to the scrollview, setting Scrollview.Panel.Height to 95%y (because tabhost occupies a part of the screen) it fits OK. So, why use a TabHost? because I want to see similar size of views when you rotate the screen, forcing that horizontally has the same height as vertically. Finally, I use this: Code: Copy If Activity.Height > Activity.Width Then ScrollView1.Panel.Height = 95%y Else ScrollView1.Panel.Height = 95%x End If I'm sure there is a better way to do this, but it seems to work.
klaus Expert Licensed User Longtime User Feb 8, 2014 #14 In another layout I have the views, filled by using %y in the Designer script. I want to fill the whole screen but I don't know the resolution. Click to expand... Do you really set the layout with %y values for both orientations ? They will be stretched in portrait and comressed in landscape. Anyway, you know the Top and Height properties of the view which occupies the lowest position on the ScrollView.Panel. You must set ScrollView.Panel.Height = LowestView.Top + LowestView.Height + 10dip (10dip is the lower margin, can be different). Last edited: Feb 9, 2014 Upvote 0
In another layout I have the views, filled by using %y in the Designer script. I want to fill the whole screen but I don't know the resolution. Click to expand... Do you really set the layout with %y values for both orientations ? They will be stretched in portrait and comressed in landscape. Anyway, you know the Top and Height properties of the view which occupies the lowest position on the ScrollView.Panel. You must set ScrollView.Panel.Height = LowestView.Top + LowestView.Height + 10dip (10dip is the lower margin, can be different).