UIview size greate than 5462 not drawing any graphics

I am drawing line in my projects using UibezierPath, i am calculating and drawing line according to current width and another params. But, i have noticed that if view (in which i am drawing lines )'s width exceed 5462, it doesn't show up.

Is there something that i am missing, or there is limitations of maximum size of uiview or anything else.

Answers

  • adamkempadamkemp USInsider, Developer Group Leader mod

    The backing layer for the view is too big to fit in memory. Your view is too big.

  • MilanLakhaniMilanLakhani USMember ✭✭

    I know but it is necessary for me to do the same. Is there any alternate solution for this without using multiple views for one line drawing.

  • adamkempadamkemp USInsider, Developer Group Leader mod

    You should be more precise in how you define your requirements. It's not a requirement to have a view that is so big. It's a requirement that it appear to the user that the view is so big. You can accomplish that with tiled layers. This example may be helpful.

  • MilanLakhaniMilanLakhani USMember ✭✭

    In my case i have one scrollview which describe the timeline, which shows one day time between 0 hours to 24 hours. To fulfill this requirement, i have added one view inside scrollview (as i cannot draw lines or graphics directly to scrollview) and drawing lines according to that.
    Another thing i am giving user to check time precisely option called hour scale (3,6 etc). Means if user selects 3 hour scale then 3 hours will be visible to the user at a time and then user scroll the scrollview to see more. (less the hours gives precise view for every seconds)

    This works fine execpt iPhone 6 plus landscape in 3hour scale. In this i have traced the things and come to know that if UIView's size goes larger than 5461 it will not draw any lines.

    So, as per requirement i have to give view size as much as scrollview's content size.

  • adamkempadamkemp USInsider, Developer Group Leader mod

    So, as per requirement i have to give view size as much as scrollview's content size.

    Again, no. That's not a requirement. The requirement is that a user has to be able to scroll to see all of the lines. The view doesn't actually have to be that big or be rendered in one single piece. That's an implementation detail, not a requirement. A better implementation that still meets your requirements is to use a CATiledLayer or some other trick to break the rendered view into smaller pieces and only render those small segments. Another more complex approach is to use OpenGL and render only what the user can see (we do this for our graph and chart controls in this app and this app). There are several ways of implementing this without rendering one giant view. That approach is just not going to work so the quicker you abandon it the better off you'll be.

  • MilanLakhaniMilanLakhani USMember ✭✭

    Thanks @adamkemp for answer.

    I have did the same with the help of CATiledlayer.

Sign In or Register to comment.