I have to present a small (40-50) number of JPG portrait files in a Horizontal ScrollView (hsv1). The images are all portrait orientation, of similar size but are of slightly differing aspect ratios.
With the code below (using LoadBitmapResize) the images fit perfectly within the view but the scrolling action is jerky giving a poor user experience. If I employ LoadBitmapResample and play with the GRAVITY property the scrolling is now perfectly smooth but the images are either cropped or distorted. There does not appear to be any combination of methods to produce the desired result with smooth scrolling.
What is the correct method to use?
With the code below (using LoadBitmapResize) the images fit perfectly within the view but the scrolling action is jerky giving a poor user experience. If I employ LoadBitmapResample and play with the GRAVITY property the scrolling is now perfectly smooth but the images are either cropped or distorted. There does not appear to be any combination of methods to produce the desired result with smooth scrolling.
What is the correct method to use?
B4X:
Dim Img as ImageView
hsv1.Panel.Width = Activity.Width * PictureNames.Size
For c = 0 To PictureNames.Size -1
Img.Initialize("")
Img.Gravity = Gravity.CENTER
Img.Bitmap = LoadBitmapResize(AppDir, PictureNames.Get(c), Activity.Width, Activity.Height, True)
hsv1.Panel.AddView(Img,c * Activity.Width,0,Activity.Width,Activity.Height)
Next