NGUI ScrollView Summary

Source: Internet
Author: User

The 1 top-level parent class plus boxcollider and Uidragscrollview scripts ensure that after the item is dragged, it can also be manipulated by dragging the remaining area.

2 Add UIPanel at the next level in the clipping Settings area, note that if you set Softclip, you cannot guarantee that the item will fill, starting with an alpha value of 1. 3 Add Uiscrollview Script and Springpanel script (if location is not zero to set in Springpanel). 4 again subordinate to ensure that the item position is always appropriate add the Uicenteronchild script (if added is not guaranteed to fill), if you want to automatically arrange the item then add the Uigrid script, note the position of this level, his position will determine the starting position of the automatically arranged item. 5item level If you have Boxcollider, add a Uidragscrollview script to ensure that you can also respond when you drag item. 6item level If you have Boxcollider you can add Uicenteronclick script by clicking to center yourself.

In the Ngui, ScrollView is a very good interface, but the beginning of the use of the time has been a few things do not understand, now is understood, can be easy to get started, the following some attention to the issue of writing to share.

One is the rebound problem, when starting to do, has not understood the example of the rebound effect is how to achieve, such effect

It's true that this effect is very popular on iOS, and the user experience is great, and its principle is done with a uidragpanelcontents code control.

There is such an object in the UIPanel of window outline, the role of the example interface is a scrollview background, the reason can rebound all rely on this, click on this object, to add a collier and Uidragpanelcontents, Set the Draggable Panel property to clipped view to see the effect, and keep in mind that this background is best to zoom in so that the fingers can slide scrollview in the area of the background.

If you don't want to see this background in your own interface, but it doesn't work, the best way to do this is to set the alpha value of this layer to 0 so that it becomes transparent and invisible.

Of course, if your inside is just the text picture and so on, the basic end, but if it is the response of the control, such as a button, you can have an unresponsive problem, that is, you can swipe, but the button cannot be clicked, causing the reason is actually collider relationship, This touch of the background of the collider than the Button collider to rely on the front, causing the trigger to accept the first, so the button will not respond.

The solution is to touch the background of this layer of the z-axis after some, placed behind the button, so that the problem can be solved.

Second, ScrollView inside the item is not filled but can be pulled, will cause the change of the position of the item and can not reply to the location, if not want to be pulled, only the inside of the item beyond the display interface can be pulled, Just tick the Disable Drag If fits on the Scrollviewpanel.

NGUI ScrollView Summary

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.