Hey im pretty new to xcode and need help. I am trying to make an app that will view lots of cars. What i am trying to do is make a table like in the "photo" applicatiion that comes with the iphone. i would like to be able to make it in a grid view like photo ad be clickable to display the image in full screen. I know how to add photos into the resources but just need help creating the table. could someone tell me how to do it in interface builder or just by code. All i am looking for is a way to replicate the photo application of the iphone but with my own photos.All help is appreciated. cheers!!!
Hey im pretty new to xcode and need help. I am trying to make an app that will view lots of cars. What i am trying to do is make a table like in the "photo" applicatiion that comes with the iphone. i would like to be able to make it in a grid view like photo ad be clickable to display the image in full screen. I know how to add photos into the resources but just need help creating the table. could someone tell me how to do it in interface builder or just by code. All i am looking for is a way to replicate the photo application of the iphone but with my own photos.All help is appreciated. cheers!!!
i don't know exactly how the photo viewer works, but i'm assuming that in IB you put a UIScrollView as the whole view, or however much of the view you want to cover. then as you have your thumbnails, say 64X64, you add UIImageViews that you create in your code, one after another, 4 to a row, (or however many fit, you probably want to make it nice and balanced like the photo viewer), and display the thumbnail there.
it's just firguring out the coordinates for each UIImageView.
i don't know exactly how the photo viewer works, but i'm assuming that in IB you put a UIScrollView as the whole view, or however much of the view you want to cover. then as you have your thumbnails, say 64X64, you add UIImageViews that you create in your code, one after another, 4 to a row, (or however many fit, you probably want to make it nice and balanced like the photo viewer), and display the thumbnail there.
it's just firguring out the coordinates for each UIImageView.
Thanks i have done this but how do i get these small thumbnail images to display in large/fullscreen like in the photos app? thanks for your help.
Thanks i have done this but how do i get these small thumbnail images to display in large/fullscreen like in the photos app? thanks for your help.
you need both. if you don't have access to a full size and a thumbnail, i'll post an algorithm that i use that i got off of another thread here to resize an image. i assume that it will work best going from larger to smaller, as smaller to larger you will lose a lot of detail.
you need both. if you don't have access to a full size and a thumbnail, i'll post an algorithm that i use that i got off of another thread here to resize an image. i assume that it will work best going from larger to smaller, as smaller to larger you will lose a lot of detail.
Nah i do have both but i dont know how link them together so when i press the small one it opens the page with the big one and im not good with the coding so have no idea on what to do so when i press the small one it will open up a page of the big one.
Nah i do have both but i dont know how link them together so when i press the small one it opens the page with the big one and im not good with the coding so have no idea on what to do so when i press the small one it will open up a page of the big one.
you are gonna be better off using a scrollview, it should work like so
1. generate views in the scrollview using nested for loops
2. each view generated, is positioned in the scrollview, and you pass the name of the thumbnail and fullsize image
3. each view has a symbolic link to the main controller
the scrollviewcontroller is pushed into a navigation stack
4. in each view, you have passed the name of the thumbnail, and fullsize image, over the top of the thumbnail which is a uiimageview and uiimage is your thumb
5. upon clicking, the fullsize image is passed through the parent symbolic link to the main controller, new controller is created, fed the fullsize image, and pushed into the stack.
6. clicking back on the navigation controller pops the current controller, and you go back to the main scrollview with all your thumbnails
dont know if this makes sense, or if you have used scrollview or navigationcontrollers, but that is the way i would do it
scrollview means less hasstle in uitableview and trying to customize it
in there, the 2 classes you want to focus on are maincontroller.h and .m and button.h and .m
in button.h, i make the class maincontroller available to button.h
@class maincontroller
and then i declare a property
maincontroller *parentLink;
and
@property(assign,nonatomic)maincontroller *parentLink;
this creates the pointer, but it only knows that its of the class maincontroller
now, in the maincontroller.m file, i say obj.parentLink = self;
so when i generate the UIView object, im telling it that i want to create a symbolic (thats what i call it anyway) link back to mainController
this means, from any uiview that is generated in maincontroller object, i can reach back and run its methods, there fore creating the link.
when you build and go in the buttonsGalore project, click one of the buttons, it traces in NSLog (look at the console) showing that a method from the mainController was run, and was called in a subview.
in there, the 2 classes you want to focus on are maincontroller.h and .m and button.h and .m
in button.h, i make the class maincontroller available to button.h
@class maincontroller
and then i declare a property
maincontroller *parentLink;
and
@property(assign,nonatomic)maincontroller *parentLink;
this creates the pointer, but it only knows that its of the class maincontroller
now, in the maincontroller.m file, i say obj.parentLink = self;
so when i generate the UIView object, im telling it that i want to create a symbolic (thats what i call it anyway) link back to mainController
this means, from any uiview that is generated in maincontroller object, i can reach back and run its methods, there fore creating the link.
when you build and go in the buttonsGalore project, click one of the buttons, it traces in NSLog (look at the console) showing that a method from the mainController was run, and was called in a subview.
to go into how you position the UIViews inside the scrollview, thats the nifty part
you have 2 for loops
for(int rows=0; rows<=10; rows++){
for(int cols=0; cols<=1; cols++)
{
// here you calculate the x and y coordinates of the UIViews position using the values rows and cols with some simple addition and multiplication based on the size of the thumbnails
}
}
it means that each time rows runs 1 time
cols will run twice, so you can change that and have 3 images per row
where cols would be cols<=2 inside the for loop (that means it will go in sequence 0,1,2)
you are gonna be better off using a scrollview, it should work like so
1. generate views in the scrollview using nested for loops
2. each view generated, is positioned in the scrollview, and you pass the name of the thumbnail and fullsize image
3. each view has a symbolic link to the main controller
the scrollviewcontroller is pushed into a navigation stack
4. in each view, you have passed the name of the thumbnail, and fullsize image, over the top of the thumbnail which is a uiimageview and uiimage is your thumb
5. upon clicking, the fullsize image is passed through the parent symbolic link to the main controller, new controller is created, fed the fullsize image, and pushed into the stack.
6. clicking back on the navigation controller pops the current controller, and you go back to the main scrollview with all your thumbnails
dont know if this makes sense, or if you have used scrollview or navigationcontrollers, but that is the way i would do it
scrollview means less hasstle in uitableview and trying to customize it
Sorry an but i still dont understand. I have used a scroll view but what is the code i should use to link these small images to the big ones in full screen can you provide me with some code please. cheers
Sorry an but i still dont understand. I have used a scroll view but what is the code i should use to link these small images to the big ones in full screen can you provide me with some code please. cheers
i will see if i have something floating around with a scrollview code, and how it works
you are gonna be better off using a scrollview, it should work like so
1. generate views in the scrollview using nested for loops
2. each view generated, is positioned in the scrollview, and you pass the name of the thumbnail and fullsize image
3. each view has a symbolic link to the main controller
the scrollviewcontroller is pushed into a navigation stack
4. in each view, you have passed the name of the thumbnail, and fullsize image, over the top of the thumbnail which is a uiimageview and uiimage is your thumb
5. upon clicking, the fullsize image is passed through the parent symbolic link to the main controller, new controller is created, fed the fullsize image, and pushed into the stack.
6. clicking back on the navigation controller pops the current controller, and you go back to the main scrollview with all your thumbnails
dont know if this makes sense, or if you have used scrollview or navigationcontrollers, but that is the way i would do it
scrollview means less hasstle in uitableview and trying to customize it
Hello, I am a newbie,
do you have any sample code of this algorithm.
Basically I need the similar thing. I need to create a scrilable view of thumbnails and clicking on them show me the full size of the image.
but dunno how to create array of thubnails....
Cool stuff mr tickle.. Thanks for sharing!
I wonder how hard it is to make the fullview into a scrollView aswell, so you could slide from image to image horizontally (like the native photo album app)
I have tried to create a photo gallery for some time, but got struck in the process of figuring out how to specify which image the user picked, what the previous image and next image is, so the scrollview would be able to load these for the user to slide through the image gallery.
Cool stuff mr tickle.. Thanks for sharing!
I wonder how hard it is to make the fullview into a scrollView aswell, so you could slide from image to image horizontally (like the native photo album app)
I have tried to create a photo gallery for some time, but got struck in the process of figuring out how to specify which image the user picked, what the previous image and next image is, so the scrollview would be able to load these for the user to slide through the image gallery.
thats not difficult either.
first off, look at the key parameter you have here
image name
so, we can say that you insert a scrollview in the fullview, and you do something like the following.
1. send the image name to the fullview class
2. the fullview class needs access to the full array of images available. You might think of sending it through with the call to initiate the class as another parameter.
3. insert your full image into the scrollview, increasing increments for the horizontal location inside the scrollview, call it xpos
4. here is the cool part. repeat through the image array, comparing the imagename you have with the entries inside the imagesArray, if it doesnt match, something like :
if(![myImageName isEqualToString:[[myFullImagesArray objectAtIndex:yourRepeatVal] objectAtIndex:thepositionofImageName])
{
// increase the xpos by the width of the screen
//insert the image
}
else
{
// you just found the image the user selected, do nothing and let the for loop skip to the next value and dont increase the xpos value
}
this should mean that the first image in the scrollview is the image you selected, and all images after are in the same order, just missing the image selected in the thumbnail view. Turn on paging in the scrollview, so you can stutter skip through them.
that should do it
i can take a look at the demo i created and see how quick i can do it, im swamped at the moment, but not with iphone, php sql and stupid websites
i can take a look at the demo i created and see how quick i can do it, im swamped at the moment, but not with iphone, php sql and stupid websites
ahhhhhhh iphone dev, my favourite.....
Yeah, that would be great!
Actually, what Im doing is having a tableview populated from a rss feed with galleries. when a row is pressed, I want the thumb view of a specific gallery to be visible.
Its here your code comes into play. Receiving an array of images from the tableView, and you are the expect in the rest
Actually, what Im doing is having a tableview populated from a rss feed with galleries. when a row is pressed, I want the thumb view of a specific gallery to be visible.
Its here your code comes into play. Receiving an array of images from the tableView, and you are the expect in the rest
Thanks for talking your time to help me out!
well, thats also not difficult to change the format.
i mean, your table view will be easier to handle inside a navigation controller, so you push uiviewcontrollers into it, the stack should have this workflow
all this is sat in one main controller, say "appController" it actually makes things easier, because appController is responsible for pushing and popping all of the controllers onto the stack, so you will find it easier to pass on the parameters to the nested controllers inside the navigation controller, usually from inside a controller, pass back messages using nsnotification if need be.
i will try to take a look at the demo i currently have, and see how easy it is to show everyone how to do it.
Thanks for this sample code. Is there a way to generate 4 columns in the code below. I have been playing around with this and can't figure it out. It surely can't be hard! And is it easy enough to link a page instead of a photo? Thanks in advance.
---------------------------------------------
Originally Posted by mr tickle View Post
ok, go here, and download the zip
in there, the 2 classes you want to focus on are maincontroller.h and .m and button.h and .m
in button.h, i make the class maincontroller available to button.h
@class maincontroller
and then i declare a property
maincontroller *parentLink;
and
@property(assign,nonatomic)maincontroller *parentLink;
this creates the pointer, but it only knows that its of the class maincontroller
now, in the maincontroller.m file, i say obj.parentLink = self;
so when i generate the UIView object, im telling it that i want to create a symbolic (thats what i call it anyway) link back to mainController
this means, from any uiview that is generated in maincontroller object, i can reach back and run its methods, there fore creating the link.
when you build and go in the buttonsGalore project, click one of the buttons, it traces in NSLog (look at the console) showing that a method from the mainController was run, and was called in a subview.