Why doesn't android:layout_gravity= "bottom" work in Android layout?

Source: Internet
Author: User
In the Android layout we sometimes need to place controls in the LinearLayout layout at the bottom of the layout, or if we want to align the bottom of several controls at the same time, we naturally think of using android:layout_gravity= "Bottom" put the control at the bottom of the linear layout, but this is not working, this problem today also bothered me for a long time, I thought it was the other place in the layout of the wrong or other places to make a mistake to appear this situation, finally no way to check the data to find the following rules:

When you linearlayout a layout:

When the total layout is horizontal layout when android:orientation= "Horizontal" , only the Top,bottom property in the vertical direction is working, and the horizontal direction of the property is not working;

Similarly, when the total layout is horizontal, that is, when the android:orientation= "vertical" is only top,bottom in the horizontal direction at this time The property is functional, and the vertical direction of the property is not functional.

Why doesn't android:layout_gravity= "bottom" work in Android layout?

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.