Tips for IOS arrow type view

Source: Internet
Author: User

Recent projects require the development of a guided view of arrows, where the contents of the view are variable.

According to the product requirements, summed up some experience:

A product requirement:

1 arrows to the horizontal center of the graph to be pointed;

2 The boot view is fixed in size, but the position requirement varies according to the position being directed;

Second experience:

1 calculates the position of the entire graph according to the position pointed by the arrow;

Method of calculation:

A. Based on the calculation in the arrow play, the position of the incoming arrow is considered the center of the whole Arrow graph, and the x-axis minimum and maximum position (view_min_x,view_max_x) is calculated.

B. If view_min_x is greater than or equal to 8 and view_max_x is less than or equal to the screen width-8 uses the x-coordinate of the view_min_x as the Arrow Guide in a, and the position of the arrows in the entire arrow graphic in the play

C. If view_min_x is less than 8 and view_max_x is less than or equal to the screen width-8, use 8 as the x-coordinate of the arrow guide, and place the incoming arrow x-coordinate-8 as the arrow

D. If view_min_x is greater than or equal to 8 and view_max_x is greater than screen width-8, use the screen width -8.0f-arrow Guide width as the x-coordinate of the arrow guide, and the arrow x coordinate-8 as the position of the arrow

(8 is the left and right interval with 8 points)

2 Drawing Arrow Graphics uses Cashapelayer to draw arrow shapes, requires rounded corners, and notes the coordinates of the center point when drawing fillets

See below for three specific implementations:

Tips for IOS arrow type view

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.