I have a ScrollView which behaves like a Slide Show. It automatically slides to the next image and in the end it goes back. But while this happens i don't want the user to slide in the scrollview him self. What i do want is to make each image that slides clickable so that the user can open a specific image for example for more details.
The default setting for the scrollview is userinteractionEnabled = FALSE. No user interaction allowed so the user cant scroll. But this also disables the click on image action. When i set it to true i can click on the image but i am also able to scroll again. So what's the best way for this?
I have considered adding a transparant UIView over the scrollview and make this clickable and check which item was shown in the scrollview. But is there another way for this?
userInteractionEnabled should be set to YES, however, you can set the scrollEnabled property to NO.
With scrolling disabled, you can still adjust the scroll position programmatically, but the user can not scroll. This should work just fine for you.
Related
I am working on a Windows phone app.
I have a Grid which normally is Collapsed. But in some situation, I will programmatically change its visibility to become visible. My question is 'Is it possible to add some fade in/out animation for changing the panel from Collapsed to Visible?
If yes, how can I do that?
You can animate the Opacity property of the Grid. When your grid is to be rendered visible you set the opacity to 0 and start the animation. Don't forget to set the visibility property to Visible before you start the animation and back to Collapsed when fading out.
MSDN: Opacity animation
I am trying to create the same type of slide-up/pull-up menu (from the bottom) as the Any.do iPhone app, but not having any success.
The issue I am running into is the app was built with storyboards so I am thinking I might have to scratch that idea and use just code.
Any ideas?
There is no need to get rid of your storyboard to recreate this, that's what IBOutlets are for. Any way, it looks like this was made by creating a UIScrollView that takes up the entire screen. Then add a UITableView to the upper section of the scroll view. Mind you in order for this to work, you'll need to disable scrolling on the scroll view in the background.
From there you can programmatically add the other elements to the scroll view to be rendered off screen, since there are only three they can probably just be buttons. And finally, since scrolling is disabled on the background scroll view you can add an image with a UISwipeGestureRecognizer at the bottom of the screen to manually change the scroll view's content offset property.
In my iphone app, you get a UIView with a background image and a "start button".
When you hit the start button, the start button will be hidden, and your background aswell. You will see another image. You will also get a "back button".
You should be able to zoom the image and scroll around.
I want everything on the same UIView.
When you hit the back button, everything should get back to the first background image and the start button, and you should not be able to zoom or scroll.
How can I do this? And is it possible at all to hide a scroll view in order to just show a regular screen, in the same view?
Thanks in advance!
EDIT: Ok, I know how to hide the scroll view now, but when the scroll view is shown, you can't scroll! I have made the scroll view bigger than the screen and put a label below the "original screen". How to get it to scroll?
Add a UIScrollView to the main view in which you have the zoom/scrollable image. Simply remove it when the back button is pressed.
I have used animated GIF in my application. Actually there is a process that takes quite long and I wish to show something to the user to show progress.
I have put a picture box and put animated GIF. It is visible property is set to false.
When user clicks on Save button, its visible property is set to true but animation does not show up.
Please advise what could be the problem.
Try to reload the Image property when you set the Visible property to true.
I've a scrollview and on both sides, I've two buttons left and right.
when i click the scroll view will move left and when right button is clicked it will move right side. My scrollview has 20 buttons (approx) & on click of each button some action is performed.
Everything is perfectly implemented and working fine.
Only thing i couldn't implement is to prevent scrolling by touch. I don't want user to scroll the scrollview manually. How can i prevent it from scrolling by touch and still able to click the buttons inside the scrollview ?
Try setting yourScrollView.scrollEnabled = NO;. That should do exactly what you want.
Swift, set scrollView.isScrollEnabled = false and it should work!
Swift 3
self.scrollView.isScrollEnabled = false
If those buttons are the only interface for users, disable 'User Interaction Enabled' option of the scroll view in the Interface Builder. Or, programmatically, set userInteractionEnabled property to NO.
Maybe your issue is that when using UIView.animate and the options:
[.allowUserInteraction], is not set.
After this option set, the scrollview should stop on tap.