Android Layout_margin Invalid Solution

Source: Internet
Author: User

http://www.aichengxu.com/view/31025

1, if the use of android:layout_marginright in LinearLayout does not work, by testing the original in android2.x, if a control has a android:layout_gravity property, will appear android:layout_marginright did not have the effect, but the left margin to the right margin up, directly remove the Android:layout_gravity this attribute can be resolved

2, if it does not work in relativelayout, please add a android:layout_alignparentright= "true" in front of this code.

3, if the ScrollView in the LinearLayout set the margin class property is invalid, the workaround linearlayout add android:layout_gravity= "Top" property is OK,

4, if it is lineaerlayout put into the ScrollView or relativelayou inside the Layout_margin failure does not work, the solution in the attribute added android:layout_gravity= "Top", Note that 1 is not the same, 1 is linearlayout inside the control, and here refers to linearlayout in other controls, please distinguish between the treatment.

5, ListView inside sub-view Layout_margin Invalid solution, Android:devider+android:deviderheight property

Android Layout_margin Invalid Solution

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.