I'm trying to program a back button on a simple webView application, and I'm wondering how it's possible to send a buttonPressed message when the image I have for the back button is pressed to initiate the goBack response.
Asked
Active
Viewed 718 times
0
-
As a note, Xcode is merely an IDE, and you didn't specify any details about what platform you were asking about. Based on your other questions, I retagged this for the iOS platform. You'll get better visibility for your questions in these tags. – Brad Larson Jan 11 '12 at 17:42
2 Answers
1
This should do it.
[aButton setImage:buttonImage forState:UIControlStateNormal];
aButton.frame = CGRectMake(xPosition, yPosition, buttonImage.size.width, buttonImage.size.height);

paul jerman
- 601
- 5
- 13
-
-
That I don't know. Personally, I tested different coordinates until I got it where I wanted it. That's not to say an easy way doesn't exist, however. Sorry 'bout not being able to help you with that. – paul jerman Jan 03 '12 at 18:45
-
Yeah, that's ok. Does the xPos and yPos start in the upper left corner, and width and length adjust from there? – Jtaylorapps Jan 03 '12 at 18:49
0
If you want, you can do all of this via Interface Builder. Add a custom button, set the image to your arrow image and you are done. Hook it up to your outlet and away you go.
If you plan on doing this via code only, it isn't that much harder.

Community
- 1
- 1

Bill Burgess
- 14,054
- 6
- 49
- 86
-
-
I've figured out how to simply make a back button, as well as a few other simple functions. I'm going to try a custom button now. – Jtaylorapps Jan 04 '12 at 19:18