Making programatic changes to UIImageView Width/Height
How do I programatically make changes to the width/height of a UIImageView? This would be a single instance of the view but would have different sizes depending on which button the user selects on-screen. I can get it to display the first time with the place and size I want but then it needs to change size and I'm not finding a way to access width/height numbers without doing a CGRectMake again. I already initialized it so doing it a second time would create a second view in addition to the first. I guess I'm looking for a:
How do I programatically make changes to the width/height of a UIImageView? This would be a single instance of the view but would have different sizes depending on which button the user selects on-screen. I can get it to display the first time with the place and size I want but then it needs to change size and I'm not finding a way to access width/height numbers without doing a CGRectMake again. I already initialized it so doing it a second time would create a second view in addition to the first. I guess I'm looking for a:
myImageView.w = 10;
myImageView.h = 20;
type deal. Any thoughts?
You need to set a complete frame of the imageView.
For the above values it will be done as
I really hate it when people ask questions that have answers that are SO easily findable by reading the most basic of apple's documentation... They register for a user account, they ask the question, make it OBVIOUS they are too lazy to read page one of anything, they get their answer and they are never heard from again.
Akshay, you are a better man than I - I would not have answered this absurdity.
I really hate it when people ask questions that have answers that are SO easily findable by reading the most basic of apple's documentation... They register for a user account, they ask the question, make it OBVIOUS they are too lazy to read page one of anything, they get their answer and they are never heard from again.
Akshay, you are a better man than I - I would not have answered this absurdity.
I take it your application to work at the Samaritans was turned down
I take it your application to work at the Samaritans was turned down
I agree with Dutch.
There are a lot of incredibly lazy people on these forums. They ask questions the answer to which are quite well documented, and make it clear they have spent zero time trying to figure out the answer for themselves.
I also hate it when people say "I want to write an app that does a, b, and c. Can you post example code that does that?"
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
There are a lot of incredibly lazy people on these forums. They ask questions the answer to which are quite well documented, and make it clear they have spent zero time trying to figure out the answer for themselves.
I also hate it when people say "I want to write an app that does a, b, and c. Can you post example code that does that?"
It gets really old.
As long as I am going to be notified of the replies to a message I originally posted (and initially received a kind & helpful answer to) 8 MONTHS AGO, I feel the need to respond.
First of all, I apologize for the stupid question. With all the people willing to help (here, with web site tutorials and YouTube videos) I didn't think I needed to pass a basic skills test first before opening my mouth.
I did finish this app and it is available in the App Store. You might be interested to know that the answers to the questions I received was a very small percent of all the code I wrote over a period of a few months. Lazy you say? No. I had never written an application before. It's been a learning experience every day. I appreciate the help I received from those willing to give it.
Second, your claim that my post asks for an entire app to be written from a line of code is absurd. Nobody in here is asking for that. You make it sound like I copy & paste the answer to my question:
[myImageView setFrame:CGRectMake(myImageView.frame.origin.x,
myImageView.frame.origin.y,10,20)];
into xcode and hit Build&Go and I have a working app. Clearly impossibly!
Some of the people here are beginners (like me) who are asking for help with pieces of their code, not the entire thing. We are learning just like you did when you started out. If you want to help us, great. If not, please keep your replies to the posts you feel are worthy of your response.
There are a lot of incredibly lazy people on these forums. They ask questions the answer to which are quite well documented, and make it clear they have spent zero time trying to figure out the answer for themselves.
I also hate it when people say "I want to write an app that does a, b, and c. Can you post example code that does that?"
It gets really old.
Quote:
Originally Posted by monty747
As long as I am going to be notified of the replies to a message I originally posted (and initially received a kind & helpful answer to) 8 MONTHS AGO, I feel the need to respond.
...
Second, your claim that my post asks for an entire app to be written from a line of code is absurd.
...
Whoa there! Duncan certainly didn't claim you asked for an app to be written. He just said that's ANOTHER thing he hates seeing. And I've seen it a lot... a WHOLE lot. It does get tiresome.
Not to criticize you, but it probably would have helped the situation if, back in November, you'd responded to this thread saying "thanks, that worked great!". I mean, when I've responded to threads and not gotten any feedback (which happens probably half the time, maybe more), it doesn't make me mad or anything, but it does make me wonder if the OP ever even read the reply, or ever visited the forum again at all.
Anyway, congrats on publishing your app! I'm sure you learned a lot in the process. Hopefully you'll be active in the forums and help out wherever you can. Also, would you care to share a link to the app, or the name of the app? Just curious; I always like to see what people on the board have out there.
__________________ Recall It!Tag your notes. Tag your photos. Tag your thoughts. Tag your life.
Whoa there! Duncan certainly didn't claim you asked for an app to be written. He just said that's ANOTHER thing he hates seeing. And I've seen it a lot... a WHOLE lot. It does get tiresome.
Not to criticize you, but it probably would have helped the situation if, back in November, you'd responded to this thread saying "thanks, that worked great!". I mean, when I've responded to threads and not gotten any feedback (which happens probably half the time, maybe more), it doesn't make me mad or anything, but it does make me wonder if the OP ever even read the reply, or ever visited the forum again at all.
Anyway, congrats on publishing your app! I'm sure you learned a lot in the process. Hopefully you'll be active in the forums and help out wherever you can. Also, would you care to share a link to the app, or the name of the app? Just curious; I always like to see what people on the board have out there.
You are right, I should have responded with a "thank you" here in the forum and will do in the future. I usually communicate a few more times directly (via email) with the people who have graciously taken their time to help me. I cannot remember if Akshay was one. Either way, I should do it here too.
I was reminded that I should have thanked you long ago for your help. If you are still able to receive this message, you should know that your snipped of code was exactly what I was looking for and could not find anywhere else. I did a search just now and still couldn't find it. Perhaps I'm looking in the wrong places but either way you solved my issue quickly. I hope there are many more people like you here in this forum who are willing to share bits of their expertise with those who may just be starting out.
I tried to download your app (in your signature) to give even more thanks and the App Store did locat it but gave an error when I tried to buy. Saying it was no longer available. I guess this will have to do. Thanks again.
You are right, I should have responded with a "thank you" here in the forum and will do in the future. I usually communicate a few more times directly (via email) with the people who have graciously taken their time to help me. I cannot remember if Akshay was one. Either way, I should do it here too.
Honestly, I wasn't trying to jump down your throat about not posting an official "thanks" earlier.
But also, since you've gotten through your first app, I expect there are places around here you can now help out. Hope you will... that's the only thing that keeps the forum going!
And it would be cool if you added your app store link to your signature.
__________________ Recall It!Tag your notes. Tag your photos. Tag your thoughts. Tag your life.
As long as I am going to be notified of the replies to a message I originally posted (and initially received a kind & helpful answer to) 8 MONTHS AGO, I feel the need to respond.
First of all, I apologize for the stupid question. With all the people willing to help (here, with web site tutorials and YouTube videos) I didn't think I needed to pass a basic skills test first before opening my mouth.
I did finish this app and it is available in the App Store. You might be interested to know that the answers to the questions I received was a very small percent of all the code I wrote over a period of a few months. Lazy you say? No. I had never written an application before. It's been a learning experience every day. I appreciate the help I received from those willing to give it.
Second, your claim that my post asks for an entire app to be written from a line of code is absurd. Nobody in here is asking for that. You make it sound like I copy & paste the answer to my question:
[myImageView setFrame:CGRectMake(myImageView.frame.origin.x,
myImageView.frame.origin.y,10,20)];
into xcode and hit Build&Go and I have a working app. Clearly impossibly!
Some of the people here are beginners (like me) who are asking for help with pieces of their code, not the entire thing. We are learning just like you did when you started out. If you want to help us, great. If not, please keep your replies to the posts you feel are worthy of your response.
Monty,
I apologize. I expressed a general frustration about lazy people in your thread, which had the effect of distilling that frustration and aiming it at you. It wasn't fair.
I'm glad to hear that you resolved your problem and went on to release an app to the store. Well done.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
I really hate it when people ask questions that have answers that are SO easily findable by reading the most basic of apple's documentation... They register for a user account, they ask the question, make it OBVIOUS they are too lazy to read page one of anything, they get their answer and they are never heard from again.
Akshay, you are a better man than I - I would not have answered this absurdity.
i tried to implement this solution to make programmatic changes to the uiimageview dimensions, but failed. not sure y it didn't work. maybe we can get together to discuss it, i'll be in ny for a show next weekend. thanks!
There are a lot of incredibly lazy people on these forums. They ask questions the answer to which are quite well documented, and make it clear they have spent zero time trying to figure out the answer for themselves.
I also hate it when people say "I want to write an app that does a, b, and c. Can you post example code that does that?"
It gets really old.
hey, thanks for contributing to the thread, but unfortunately i couldn't make your solution work either, much the same as dutch's, so i've already asked for his assistance. i'm new to the game tho so it's to be expected i guess. anyways, it says on the left there that you're in NVA - i'm just outside of reston, so maybe you can explain further? i'm free everyday and can be there asap, i mean cuz i just can't figure out how to set these dimensions.