I'm trying to implement a UIImageView that shows different .png (organized in a NSArray) at each tap. When the tap reaches the last .png, the next tap will show the first .png and so on. I found an old answer here: Add 4 image in imageview and change the picture with tap or swipe gesture that seems to go in the right direction. However, it doesn't seem to be applicable in the new XCode and there is no more possibility to ask clarifications or updates since the topic has been closed. Does anybody have an idea on how to subclass then entire ImageView to get the expected result?
Add multiple image in same UIImageView and change them at each tap
122 Views Asked by Stefano At
1
There are 1 best solutions below
Related Questions in IMAGE
- Add image to JCheckBoxMenuItem
- Display images on Django Template Site
- How to resize images with PHP PARSE SDK
- Animation in Java on top of JPanel
- Slow performance on ipad erasing image
- What are the pros and cons of the picture element?
- Carrierwave file upload with different file types
- How to use annotorious with angular
- Images not showing when uploaded to server
- ImageView doesn't show up
- Image Resizing adjusts ratio
- Displaying bitmap image on Android (OpenCV)
- Class 'Imagick' not found - PHP and Windows
- Image position - randomly select position
- Replace image 1 with image 2 after 5 sec
Related Questions in NSARRAY
- Convert this to javascript
- mutating method sent to immutable object' in nsmutablearray
- Shuffle NSArray
- Objective C - How do I convert this NSArray to an NSDictionary so I can look up city names by zip code?
- iOS - Add NSDictinary key values into an NSArray sequencialy
- How to get a specific object from data structure based on Index
- Parsing a Dictionary of Arrays from a Plist file
- NSPredicate with bitmask for filtering NSArray
- Load/Save NSUserDefaults Array - Bools?
- indexOfObject:inSortedRange:options:usingComparator returns wrong index
- NSArray element failed to match the Swift Array Element type in mapView.annotations loop
- Sort NSArray to a particular sequence using an NSComparisonResult
- Overwriting NSMutableArray loaded from NSUserDefaults
- Check if array contains part of a string in Swift?
- Pass data from method to method
Related Questions in TAP
- Tap counter with backward in jQuery
- How to animate an object vertically with touch like Spotify's music player does when tapping the song,
- Add multiple image in same UIImageView and change them at each tap
- Swift Gesture recognizers added to textfield inoperable after becomes first responder?
- Swift : Button click stops tapGestureDidRecognize on the parent View
- How distinguish between consecutive tapping and single taps? Unity animation?
- Tap interface is not receiving packets
- How to make `make check` process TAP output?
- Corona SDK event.target touch/tap
- $.Deferred() and $.ajax() not working in Node.JS
- How to get position/coordinates of a tap-event with jquery-mobile?
- TAP::Harness perl tests tee output
- how can I get image tag from different image views on tapping on it
- Load image when screen tapped
- Prevent href because of taphold dialog
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The solution was much easier than I thought.
As a custom value to the selector cannot be passed in the way I asked, I created an helper property that holds the index of the currently displayed image, increment that on every tap and set the image accordingly.
Please note: there might be a better approach to this, but this is what it worked in my case. Hope this can be helpful.