stupid iPhone
-
So, the iPhone has a control called a UIScrollView. It is nice, I give it a view ( such as an image ) and I get scrolling/panning for free. But, it seems I cannot set the zoom or scroll position in code. So, if I zoom and then go to another image, the image starts zoomed. If I try to get around this in code, the best I can do, if my initial zoom range is 1 to 4, and I am zoomed to 3, I make my range from 3-12 and I draw the image scaled to that factor. If I try to do this with a text control, the text goes all blurry. It's a real mess. Why would you write a control and not let the programmer set it's state ?
Christian Graus Driven to the arms of OSX by Vista.
It's called a scrollview not a zoomview. :rolleyes: ;P
-
So, the iPhone has a control called a UIScrollView. It is nice, I give it a view ( such as an image ) and I get scrolling/panning for free. But, it seems I cannot set the zoom or scroll position in code. So, if I zoom and then go to another image, the image starts zoomed. If I try to get around this in code, the best I can do, if my initial zoom range is 1 to 4, and I am zoomed to 3, I make my range from 3-12 and I draw the image scaled to that factor. If I try to do this with a text control, the text goes all blurry. It's a real mess. Why would you write a control and not let the programmer set it's state ?
Christian Graus Driven to the arms of OSX by Vista.
I looked up UIScrollView on google and noticed that people mention a delegate class. In Cocoa a lot of the classes have delegates that allow you to customize the way the control works. Have you checked this out? It might have methods that you can implement to do what you want. //edit UIScrollViewDelegate protocol - that's *possibly* what you want to look at. Maybe, just guessing... Found this too: http://halmueller.wordpress.com/2008/10/08/a-very-simple-uiscrollview-demo/[^] Is this at all similar to what you're referring to?
-
So, the iPhone has a control called a UIScrollView. It is nice, I give it a view ( such as an image ) and I get scrolling/panning for free. But, it seems I cannot set the zoom or scroll position in code. So, if I zoom and then go to another image, the image starts zoomed. If I try to get around this in code, the best I can do, if my initial zoom range is 1 to 4, and I am zoomed to 3, I make my range from 3-12 and I draw the image scaled to that factor. If I try to do this with a text control, the text goes all blurry. It's a real mess. Why would you write a control and not let the programmer set it's state ?
Christian Graus Driven to the arms of OSX by Vista.
Delete it and create another instance each time you want to change the image? The state might be built up from a series of transformations like you would do in a 3D application. That might make setting the state a bit more challenging.
Todd Smith
-
So, the iPhone has a control called a UIScrollView. It is nice, I give it a view ( such as an image ) and I get scrolling/panning for free. But, it seems I cannot set the zoom or scroll position in code. So, if I zoom and then go to another image, the image starts zoomed. If I try to get around this in code, the best I can do, if my initial zoom range is 1 to 4, and I am zoomed to 3, I make my range from 3-12 and I draw the image scaled to that factor. If I try to do this with a text control, the text goes all blurry. It's a real mess. Why would you write a control and not let the programmer set it's state ?
Christian Graus Driven to the arms of OSX by Vista.
Not so stupid: comparison[^] or another link[^]
-- Jarek Andrzejewski
-
I looked up UIScrollView on google and noticed that people mention a delegate class. In Cocoa a lot of the classes have delegates that allow you to customize the way the control works. Have you checked this out? It might have methods that you can implement to do what you want. //edit UIScrollViewDelegate protocol - that's *possibly* what you want to look at. Maybe, just guessing... Found this too: http://halmueller.wordpress.com/2008/10/08/a-very-simple-uiscrollview-demo/[^] Is this at all similar to what you're referring to?
Yeah, the delegate tells me what I am zoomed to. It doesn't let me set anything tho. I will look at this sample, the way that it makes the images crisp again may be what I need for my label, excepting that I'm not sure if I can use CATiledLayer in my code....
Christian Graus Driven to the arms of OSX by Vista.
-
Delete it and create another instance each time you want to change the image? The state might be built up from a series of transformations like you would do in a 3D application. That might make setting the state a bit more challenging.
Todd Smith
Todd Smith wrote:
Delete it and create another instance each time you want to change the image?
Yeah, that is a possible solution, but I'm nervous about doing it that way.
Christian Graus Driven to the arms of OSX by Vista.
-
*grin* well, I wrote my own, and it worked OK, but it wasn't as sexy, and I prefer to use the standard controls, so the behaviour is exactly as people expect. But yeah, I got less than I paid for with this phone, I tell you.
Christian Graus Driven to the arms of OSX by Vista.
i'm in san fran ... do you need me to pop down to cupertino and get you a fresh batch of kool aid? sounds like yours is wearing off :rolleyes:
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
-
i'm in san fran ... do you need me to pop down to cupertino and get you a fresh batch of kool aid? sounds like yours is wearing off :rolleyes:
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
My new Mac Pro is evening the score in Apple's favour. I still hate the damn phone tho.
Christian Graus Driven to the arms of OSX by Vista.
-
So, the iPhone has a control called a UIScrollView. It is nice, I give it a view ( such as an image ) and I get scrolling/panning for free. But, it seems I cannot set the zoom or scroll position in code. So, if I zoom and then go to another image, the image starts zoomed. If I try to get around this in code, the best I can do, if my initial zoom range is 1 to 4, and I am zoomed to 3, I make my range from 3-12 and I draw the image scaled to that factor. If I try to do this with a text control, the text goes all blurry. It's a real mess. Why would you write a control and not let the programmer set it's state ?
Christian Graus Driven to the arms of OSX by Vista.
OT: What are you guys doing about automated testing for your iPhone apps? Unit testing and coverage is easy enough but we are struggling to find an acceptance testing solution. My current, and awful, idea is to use Automator to simulate "clicks" in the iPhone simulator, take screenshots and compare against baseline screenshots... (I'll ask some co-workers about UIScrollView when I get in to work, they know more than I do.)
cheers, Paul M. Watson.
-
OT: What are you guys doing about automated testing for your iPhone apps? Unit testing and coverage is easy enough but we are struggling to find an acceptance testing solution. My current, and awful, idea is to use Automator to simulate "clicks" in the iPhone simulator, take screenshots and compare against baseline screenshots... (I'll ask some co-workers about UIScrollView when I get in to work, they know more than I do.)
cheers, Paul M. Watson.
Our app is simple enough that we won't do much more than do some testing ourselves and run with that. We don't have any other resources...
Christian Graus Driven to the arms of OSX by Vista.
-
Our app is simple enough that we won't do much more than do some testing ourselves and run with that. We don't have any other resources...
Christian Graus Driven to the arms of OSX by Vista.
Fair enough. If you do come across some kind of acceptance test framework please drop me a line. Our testing department is grumbling :)
cheers, Paul M. Watson.