B bazp Member Licensed User Longtime User Nov 18, 2011 #1 I modified my vertical scrollview program(it is working) to horizontal. I am only getting 1 picture with no scroll. Below is the code I used based on Erels example. For i = 0 To Bitmaps.Size - 1 Dim iv As ImageView 'create an ImageView for each bitmap iv.Initialize("iv") Dim bd As BitmapDrawable bd.Initialize(Bitmaps.Get(i)) iv.Background = bd 'set the background of the image view. iv.Tag=i HorizontalScrollView1.Panel.AddView(iv, 5dip, 5dip + i * 300dip, HorizontalScrollView1.Width - 10dip, 300dip) Next
I modified my vertical scrollview program(it is working) to horizontal. I am only getting 1 picture with no scroll. Below is the code I used based on Erels example. For i = 0 To Bitmaps.Size - 1 Dim iv As ImageView 'create an ImageView for each bitmap iv.Initialize("iv") Dim bd As BitmapDrawable bd.Initialize(Bitmaps.Get(i)) iv.Background = bd 'set the background of the image view. iv.Tag=i HorizontalScrollView1.Panel.AddView(iv, 5dip, 5dip + i * 300dip, HorizontalScrollView1.Width - 10dip, 300dip) Next
klaus Expert Licensed User Longtime User Nov 18, 2011 #2 You must modify HorizontalScrollView1.Panel.AddView to put the bitmaps side by side and not one below the other. In your line you increment the Top property, but you must increment the Left property. Best regards. Upvote 0
You must modify HorizontalScrollView1.Panel.AddView to put the bitmaps side by side and not one below the other. In your line you increment the Top property, but you must increment the Left property. Best regards.
Ionut Indigo Member Licensed User Longtime User Apr 2, 2012 #3 And how do you change that in the code, to show the images on o horizontal line? Code: scvImages1.Panel.AddView(imvImage,lfmImage,i*(imgHeight+imgSpace),imgWidth,imgHeight) Last edited: Apr 2, 2012 Upvote 0
And how do you change that in the code, to show the images on o horizontal line? Code: scvImages1.Panel.AddView(imvImage,lfmImage,i*(imgHeight+imgSpace),imgWidth,imgHeight)
klaus Expert Licensed User Longtime User Apr 2, 2012 #4 Something like this: Code: scvImages1.Panel.AddView(imvImage, lfmImage + i * ( imgWidth + imgSpace), imgSpace, imgWidth, imgHeight) Best regards. Upvote 0
Something like this: Code: scvImages1.Panel.AddView(imvImage, lfmImage + i * ( imgWidth + imgSpace), imgSpace, imgWidth, imgHeight) Best regards.
Ionut Indigo Member Licensed User Longtime User Apr 6, 2012 #5 Thank you klaus, It does work better now, but i think i need to change more of the code. The last image dosen't show full (like the others) and in landscape mode the view is all messed up. I also tried to to modify the aligment with the Designer Scripts but it dosen't look good at all. Upvote 0
Thank you klaus, It does work better now, but i think i need to change more of the code. The last image dosen't show full (like the others) and in landscape mode the view is all messed up. I also tried to to modify the aligment with the Designer Scripts but it dosen't look good at all.