How to add image in UIActivityIndicatorView - iphone

i want to add image into initWithActivityIndicatorStyle instead of using the others like
UIActivityIndicatorViewStyleWhiteLarge. So, when come to loading page, the image will act as
image loading.
Any help, i am truly appreciate it . ^^
Thanks

You can't do that. UIActivityIndicatorView draws the system activity indicators. If you want to display a custom image then you shouldn't be using a UIActivityIndicatorView. Either create a custom view, or if you just want to display an image use a UIImageView. UIImageView also supports animating several images in a loop if you want to do that.

Related

What image gallery? [iPhone]

Hey guys,
checkout this. How can I do something similar? I mean a scrollview with 9x9 images.
Also, how can I put a custom loading image??
Ty.
Allocate and init a UIScrollView, add it to the viewcontroller's view, and then create UIImageViews, set their respective images, and add the image views to the scroll view.
Specifying launch images - get a pic, rename it to Default.png (also might want to get a 2x sized one - call it Default#2x.png) and copy it to the resources folder.
Use some pre-existing code. AQGridView is a solid piece of grid code.

Custom UIPickerView Background

So I want to change the UIPickerView background to add a black rectangle next to the white part of the scroller, a la the Convert app.
However I'm not sure how to go about doing that. I know there's no direct way to do it, but I've also looked at trying to write my own UIPickerView from scratch using UIScrollView. This didn't seem very promising.
Do you have any suggestions or tips? Really appreciate it.
Just create a UIImageView that contains the left portion of your graphic above. Add that UIImageView to the same view that contains your UIPickerView-- so it will draw on top of your UIPickerView.

how to reload a view again and again

hi i am a new iphone programmer
i am creating a imagedisplay type application where i have to display images on a view and by presssing a next button a new image should appear on same view (i am using database)...
therefore i need to reload my current view again and again...each time when i click that button....
i tried some suggesion which are given on this website but not satisfied because many of them are based on timer...
please help.....
May be I have missed something in your question. But why you need to reload the entire view? You are using an UIImageView to display your image, right? And you are not showing any kind of scroll, but only a next button, right? Then why don't you just set the image property of UIImageView when the button is tapped.
// in button handler
myImageView.image = [UIImage imageNamed:#"new_image.png"];
Perhaps you could use a paged UIScrollView with three uIImageViews and always have the previous, current and next image loaded. This way when the user hits next, it scrolls animated to the next image. When page 3 is loaded, it programmatically sets the second image view as the desired next image, sets the image you came from on the first image view, and sets the scroll view non-animated to page two and loads the next image in the third image view.
Sounds complicated but basically you are giving the appearance of an infinite scroller but only pulling one image at a time except for initial load of three.
You could try looking at the "PageControl" Example Project in the XCode Documentation. It should give you a good starting point.

Thumbnail slider in toolbar like iPad Photos app

I would like to put thumbnails in the toolbar like the Photos app. Like the screenshot on the left:
(source: apple.com)
Is there is a built-in control to do this, or do I have to implement it from scratch?
If the answer is from scratch, any tips?
This would be a control you'd have to write yourself. I'm not what the best approach would be, but I think I'd go with subclassing a UISlider, drawing the array of images next to each other to create the track, and then using the current image as the handle.
From scratch, is the answer, unfortunately.
You create a custom view and add your array of images as subviews using UIImageView objects incrementing your x position by the the thumbnail width you've determined to use.
Then override the touch events for you custom view. Determine which image view the touch is currently over in -touchesMoved and use Core Animation to animate the current view's scale making it larger than the rest. Add the custom view to your toolbar wrapping your custom view in a UIBarButtonItem using -initWithCustomView.
Remember to enable user interaction on your custom view or you won't receive any touch events. If you need help with the code, update your question with some code specific questions.
Should anyone still need it, I made an effort of coming up with ThumbnailPickerView - a simple UI control resembling Photos.app thumbnail slider.

UIButton Game character selection to UIImageView animation

I am almost at the end of coding my kids educational application, woohoo!.
But... Im stuck on something.
When app loads i have my main view. It has 4 buttons for flipviews(each with ten views of content) and 4 buttons for character selection(an image that will follow you through every screen of content).
Problem is im unsure on how to link UIButton selection to UIImage display in multiple views. I want the user to choose a character button and then continue to the flipviews and in the views the image displayed should be the one that they have selected on the main view. So everytime they return to the main view they can change the character that will follow them around the app.
Any thoughts, help or code would be much appreciated!
Thank You
Alex
Make a new object, a subclass of UIImageView, which has a -setImage method. Once you set the image, then where ever you embed that object, it will display the same image. You could even have that subclass view have a score displayed next to it, or a name or other stats, so as you go from one screen to another, you have all that info follow you around with the image. No need to create labels in all the screens for global info like that.
In summary:
make a new subclass of UIView or UIImageView in Xcode using the New File... menu. You would do new UIView if you will have other items than just an image.
add methods that allow you to set the image, update text stats etc.
BONUS: you can make the class handle taps, so if a user taps the image, you could do something like provide help or run a cute little animation
embed that object in any screens you wish. Keep in mind that you can have that view be sized differently in each screen using transforms. Cool, no?
that's pretty much it!
Good luck!