Button outside view... how to make it work

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-04-17T04:51:38Z Indexed on 2010/04/17 4:53 UTC
Read the original article Hit count: 296

Filed under:
|
|
|

I have a UIImageView based class that creates objects with the following characteristics: a small image square and a UITextView below.

If the user drags the object by the image it can drag it around.

If the user taps on the UITextView the keyboard has to appear and the user can change the text on it.

The objects created by the class are like this:

1) the object creates a 60x60 pixels frame 2) puts an image inside that frame 3) creates a UITextView and puts it below that 60x60 frame.

So, as the class is a UIImageView based and it creates an image with 60x60 pixels and the UITextView is located outside that area, in theory the text view is outside the area the tapping are for that object.

Obviously I could make the class create a big square to encompass the image and the text view, but that frame would be too big and I have the objects created by this class to be as close as possible when I add them to another view.

I could also create the text views from the same view I created the objects, but I would have to manage each object and each correspondent text view and I need them to move together... so, I have a problem.

Any ideas on a simplest way to do that?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk