LinearLayout android:layout_gravity= "bottom" Android "" does not work

Classification: Android finishing 344 people read Comment(0) Collection Report

In the interface layout, we often use the LinearLayout, but sometimes it is not convenient to use, such as we have to put a Button on the screen at the bottom of the screen, at this time we set android:layout_gravity= "bottom" is no effect. Why?For LinearLayout:

When the android:orientation= "vertical", only the horizontal direction of the set to play a role in the vertical direction of the setup. Namely: left, right, center_horizontal is effective.
When android:orientation= "horizontal", only the vertical direction is set to play a role in the horizontal direction. Namely: top, bottom, center_vertical is effective.

If we want to implement a View on the phone screen to put a on the bottom, we can layout of the XML of the outermost layer (or root layout) with RelativeLayout. Again inRelativeLayout contains the LinearLayout we have written,To display in the bottom of the mobile phone view android:layout_alignParentBottom= to add the attribute true "", so you can.

Copyright statement: This article is the original article of the main Bo, without the permission of the owner.

Guess what you're looking for.
View comments
* above the user's comments only represent their personal views, do not represent the views or position of the CSDN website
    Personal data
    • Visit35227 times
    • Integral:1704
    • Grade
    • Rank:13303rd
    • Original141
    • Reprint:36
    • Translation:1
    • Comment:9
    Latest comments