views:

30

answers:

1

Hi,

I'm trying to make resizable UIViews of which users can resize (code is done for that) and drag it around. Now I need to make it look like what it looks like in IB, with circles at its corners to drag, and dotted lines as borders of the UIView.

How do you think I should go about doing this?

Many thanks.

+1  A: 

The proper way to do that is to override the drawRect: method of the UIView subclass (your draggable views in this case.)

When you subclass UIView to create a custom class that draws itself, implement the drawRect: method to draw the view within the specified region. This method is invoked the first time a view displays or when an event occurs that invalidates a part of the view’s frame requiring it to redraw its content.

You can see some instructions for doing custom drawing at: drawrect:

Good luck.

Thomas Børlum