Does anyone have some reliable code for clearing the contents of a view?
I am creating a gallery and I want to remove the imageView and add a new one to the scroll view.
I guess the other option is to change the image value of the imageView but I'm not sure how this is done…
Figured out my issues…
And this is how it is done:
- Pull from a database the list of photos including the location. Set an id of the gallery to get the proper list in the gallery view.
- Put the location of the items in an array (URL).
- Once the photo is selected figure out what the spot number is in the array for that photo.
- Add left and right buttons to traverse the gallery.
- Add events to those buttons getting the next or previous photo in the array. Change the spot use setString.
- Change the content of the views in use. Do not remove them, if you remove them you will have issues with events and the existence of views.
Although I'm nearly finished building a web based gallery feature in Titanium I think this would be a great example for the KitchenSink (I'm sure I'm not doing everything perfect). I'm currently able to pull from Picasa or Flickr.
Does anyone know how to implement left and right swipe similar to the native gallery?