Hi. i'm trying to find ImageSlider view by Tag. When i wrote code as below i got a warning "Types does not match".
How can i set ImageSlider view with return view of FindViewByTag function
Any help ?
How can i set ImageSlider view with return view of FindViewByTag function
Any help ?
B4X:
Dim slider As ImageSlider= FindViewByTag(p,"ImageSliderX") ' Types does not match".
Sub FindViewByTag(Parent As Panel, Name As String) As View
Try
For Each v As View In Parent.GetAllviewsRecursive
If Name = v.Tag And v Is ImageView Then
Return v
End If
If Name = v.Tag And v Is TextView Then
Return v
End If
If Name = v.Tag And v Is TextField Then
Return v
End If
If Name = v.Tag And v Is Button Then
Return v
End If
If Name = v.Tag And v Is Picker Then
Return v
End If
If Name = v.Tag And v Is Label Then
Return v
End If
If Name = v.Tag And v Is ImageView Then
Return v
End If
If Name = v.Tag And v Is Switch Then
Return v
End If
If Name = v.Tag And v Is Panel Then
Return v
End If
If Name = "ImageSliderX" Then '***** It's works but i cant set view by imageslider
Return v
End If
Next
Catch
'Showerror("FindViewByTag:" & LastException )
End Try
End Sub
Last edited: