LTArrow is an easy to use derivated UIView that designs an pretty arrow on itself. Several parameters can be changed for it to be personalized at max. And of course, it uses no image to be generated.
How to use :
1) Include both LTArrow.h & LTArrow.m files on your project
2) If you want to use the IB Editor :
- add a View on your project, and set its background the color you want the arrow to be shown. It will looks like this for example :
- change the class from UIView to LTArrow in the definitions panel of your object :
- Compile your project, your view will now looks like this :
LTArrow auto-detects if your view is horizontal or vertical. It starts as an opened-stroke arrow, with its line color setted by the original background color of the view (the background color is then changed to clearColor), with a lineHeight of 10 pixels, and an head angle of 60° (PI/3)
Available methods :
This allow you to change the origin of the arrow (formerly the middle base of the arrow) around your view.
This allow you to change the destination of the arrow (formerly the top head of the arrow) around your view.
This makes your arrow to be reversed (up to down in vertical mode, or left to right in horizontal mode)
This turns the coordinates (not the view) by reverting the from & to position like 90° right.
Sets the angle of the view in degree (from 0 to 379) by using the CGAffineTransformMakeRotation method
Change the height of the head of the arrow.
Change the angle of the head of the arrow. By default it is set by 60°.
Change the height of the bar of the arrow.
Change the line width of the whole arrow.
- (void)setLineColor:(UIColor *)lineColor;
Change the line color of the arrow.
- (void)setFillColor:(UIColor *)fillColor;
Change the fill color of the arrow, when the style of the arrow is ARROWMODEOPENFILL or ARROWMODECLOSEDFILL
Change the mode of how the arrow is designed, by using one of the following 4 styles :