This question already has answers here:
How to add sound while UIScrollview is scrolling in iphone sdk?
(2 answers)
Closed 3 years ago.
how to add sounds in uiscrollview,while swiping different images with different sounds.
please help me.
Thanks regards
Rajan
When scrolling stop then you can check that page is changed or not. If Changed than play sound else not.
You have to use UIScrollViewDelegate methods to achieve this task you can use
scrollViewDidEndDecelerating: to achieve this with the using one ivar to store the current display position of the UIScrollView and in this method using contentOffset.x property of the UIScrollView you can achieve what you need.
Yep you need to use AVAudioPlayer to play sound.
Think this will help you.
Happy Codding :)
Enjoy Coding :)
Related
Maybe somebody faced this kind of trouble: when using UIActionSheet on ios 5 i can call Notification Center. The problem is that i cant touch any event in NC. And it all looks not clean. So, is there some way to disable NC by program or maybe another ways to solve it?
Thanks!
I found out a quick solution:
when the Notification Center shows up, appDelegate receives (applicationWillResignActive:) and there I post a notification to remove my UIActionSheet from the screen. It's not clean but better than it was.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Tasks with my UIImageView
How can i highlight my UIImageview and display a deleteButton(cross button) on top of the imageview when user touching the UIImageview?.
You need to create a IBAction that adds the cross button and wire it to the touchDown event in interface builder. You could probably make a timer that will give it a couple seconds before activating.
Option 2: read about gestureRecognizers, they are very simple and I learned them in a couple hours.
http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/GestureRecognizers/GestureRecognizers.html <-- all about recogizers
It's pretty straight forward. Use
UILongPressGestureRecognizer
In the methods below write a code for detecting gestures and popping up a delete button.
- (void)handleGesture; //or
- (void)handleGesture:(UIGestureRecognizer *)gestureRecognizer;
For deleting use
- (void)removeTarget:(id)target action:(SEL)action
I've no experience in making something move in my app. And I observed this effect in Flickit Pro. The Tap for details view will shake for one or two second and then stop. It looks cute and very user-friendly.
So how can I make effects like this? A gif that is moving? Or some other methods with the help of Cocoa Touch?
Thanks in advance.
Di
A high-level way would be [UIView beginAnimations: context:] (where both parameters can be NULL in this simple case). Then you can just change the properties that want to change of the view that should be animated, add some other "effects" like ease-in/out, etc. pp. When you are done with this, you just call [UIView commitAnimations] and it will animate everything for you.
However, in the case that you need more freedom, look into the CAAnimation class (its inside the QuartzCore framework).
Also: Look into the documentation for both ways (UIView / CAAnimation) and look into session 424 and 425 of the 2010 WWDC.
There are already some answers on stackoverflow on this:
Shake visual effect on iPhone (NOT shaking the device)
UIView shake animation
how to create iphone's wobbling icon effect?
and here is a link that does it on mac:
http://www.cimgf.com/2008/02/27/core-animation-tutorial-window-shake-effect/
I hope these are enough links to help.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to detect Swipe Gesture in iPhone SDK?
How can I detect a swipe gesture within the interface of my iPhone application?
Create a UIView.
Create a a subclass of a UIGestureRecognizer (sounds like you'd like to use UISwipeGestureRecognizer).
Use the UIView instance method
addGestureRecognizer: to attach your UIGestureRecognizer to the UIView instance.
Seriously though... you should be reading documentation and books, or watching the Apple development videos as opposed to posting on here...
Check out the UIGestureRecognizer Class Reference. Being new to the iOS SDK, Apple Developer Documents will be one of your best friends, 2nd to Google anyway.
I'm new with the iphone programming and I'm trying to know how to create all of these (UI's) without using the IB, so I'm only asking for the code lines that will create each one of these.
The best way to figure this out is to read through the documentation for each of these classes. Some which are subclasses of UIView can be instantiated with -initWithFrame:, for example.
i am new to iphone/ipad programming , i fallowed below links to create views programmatically... i think these are helpful to u also >>
To create UIButton,UILabel,UIImage,UITextField programmatically
http://www.edumobile.org/iphone/iphone-programming-tutorials/implement-uibutton-uitextfield-and-uilabel-programmatically-in-iphone/
To create UITableView Programatically
http://thesdkblog.com/2011/05/how-to-setup-a-uitableview-programmatically/
To create UINavigationController and UITabbarController Programmatically
http://codenugget.org/how-to-embed-a-navigation-controller-inside-a
http://www.xdracco.net/howto-implement-uinavigationcontroller-uitabbarcontroller-programmatically/
Thanks u..
I've Noticed that a lot of people viewed this question, so I was doing a search on this subject and I came through a great sample code, which can explain how to do a lot of things and here is the link to that sample code:
http://developer.apple.com/iphone/library/samplecode/uicatalog/Introduction/Intro.html
I hope that this will help.