Have you ever dreamed of your own custom activity indicator within your iPhone App? The class UIImageView provides a very useful and simple way to implement such a thing. The only thing you have to do is to:
- Provide a number of images that reflect your indicator animation.
- Create a new UIImageView instance and set images and animation duration.
- Position your custom activity indicator within your current view.
To demonstrate the whole process I quickly created some images (I am sure you will style them better than me) which will serve for our animation.
.. I think you got it …
creates
So the images are prepared and now we can go to the next step and create the animation of our custom activity indicator somewhere i.e. in your current view controller. The code you need should look like the following.
As I mentioned within a code annotation, try to play arround with the duration of the animation so it fits for you. Basically thats all you have to do. For more information look at the documentation of UIImageView. There you will find some more useful methods like stopAnimating
or isAnimating
and you are also able to add images for an animation if the view is highlighted with the property highlightedAnimationImages
.
So far thats all I wanna say and I hope it will help you somehow or other,
Andreas
출처 : http://blog.blackwhale.at/2009/09/create-custom-activity-indicator-for-your-iphone-app/
'프로그램 > iPhone' 카테고리의 다른 글
샘플코드와 그림으로 잘 정리한 UINavigationController Customization Tutorial (0) | 2011.01.18 |
---|---|
UIDatepicker를 Popup 효과 내기 (0) | 2011.01.17 |
키보드에 의해 텍스트필드가 안보일 때 쓰는 스크롤뷰 (0) | 2011.01.13 |
iPhone - combobox (0) | 2011.01.12 |
tableView에서 페이지 (0) | 2011.01.12 |