Several positional coordinate relationships for Android view

Source: Internet
Author: User

1. The view boundary, left, top, right, bottom (i.e., top to bottom), these values are relative to view's parent container;

2. View x, Translationx, y, Translationy, translationx/y represent offsets relative to the left,top, and are generally used in the translation animation of the View,

Like the following relationship: X = left + Translationx, y = top + translationy;

3. View Mscrollx, mscrolly refers to the distance of the view's boundary relative to the view content, such as having a linearlayout container1, in which the immediately children

Is BTN1, then if call Container1.scrollby (0, 30), then Container1 4 boundary is never change, change is container1 content, that is BTN1

Coordinates will change, the top of BTN1 will now be reduced by 30 pixels;

4. The offsettopandbottom of the view directly changes the top, bottom, equivalent to the position of panning the view up and down in the parent; Offsetleftandright is directly changing

Left, right, which is equivalent to panning the view around the parent, the view's boundary changes directly, and because the relative position of the view and his sub-view has not changed, so his

The boundaries of the sub-view also change.

Several positional coordinate relationships for Android 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.