iOS Question ImageSlider Source

ykucuk

Well-Known Member
Licensed User
Longtime User
I added 20 panels into xCustomListView.
Each panel has an imageslider view inside with different photos.
My questions :
1- is gesture working with imageslider?
2- how can i set getimage function for all this imagesliders ?

My code
B4X:
Sub AddPosts
pnlRoot.LoadLayout("LayoutListview")

For i = 1 To 20
Listview1.Add(CreatePost(Rnd(0xFF000000, 0xFFFFFFFF),  i), "")
Next
End Sub

Sub CreatePost(clr As Int, Title As String) As B4XView

ExpandedHeight =55dip + (screenWidth*1.12-6dip)
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, Listview1.AsView.Width, ExpandedHeight)
p.LoadLayout("LayoutPost")
imgUser.Bitmap= LoadBitmap(File.DirAssets,"user" & Rnd(1,4) & ".jpg")

PanelContainer.Width=screenWidth
PanelContainer.Height=screenWidth*1.3
PanelContainer.LoadLayout("LayoutPostMedia")

'**** PostImageSlider1  = Image Slider View

Dim srcImageSlider As List
srcImageSlider.Initialize

For i = 1 To Rnd(1,7)
srcImageSlider.Add("s" & i & ".jpg")
Next

'**** How to set srcImageSlider for  PostImageSlider1(Image Slider View)

Return p

End Sub
 

Attachments

  • Simulator Screen Shot - iPhone X - 2018-09-11 at 09.35.36.png
    Simulator Screen Shot - iPhone X - 2018-09-11 at 09.35.36.png
    301 KB · Views: 150

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. Gestures are no implemented in ImageSlider. You can add it with: https://www.b4x.com/android/forum/t...zer-native-uigesturerecognizer.52836/#content

Start with a single ImageSlider.

2. There are several options here. Where do the images come from? How are the images organized?
Don't be afraid to modify ImageSlider. You can implement GetImage in such a way that it doesn't raise an event and instead returns the image immediately.
 
Upvote 0
Top