码迷,mamicode.com
首页 > 移动开发 > 详细

Android LinearLayout Why Gravity Not Work

时间:2015-04-04 18:33:26      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:

Some Android Developer may not know well of Linearlayout . This may help you to know sth about the gravity of its chilren;

-------------------CONET ------------------

1) wahts the diffrence between "gravity " android "layout_gravity"?

gravity: is sth to itself;  this tell how you want its content to layout;   Its see a TextView ; provided its wd is 200; and its content (text ) measured wd is 150;   This Gravity setting will make its text align left ? top? center ? etc...


layout_gravity: is sth to its parent ;  this tells it;s parent how it wants to be layed out; Again this TextView in its parent Linearlayout; Provided parent wd is 300, ht is 400;


2) WHY Does my layout_gravity not work?

layout_gravity is sth relevent to its parent orentation;

If its orentation is horizontal , top , btm , center_vertical will be effective;

else if is vertical : left , right ,center_horizontal is effective;





----------------------END--------------------------

THAT ALL FOR TODAY ! MY POOR UBUNTU INPUT METHOD!!!

Android LinearLayout Why Gravity Not Work

标签:

原文地址:http://my.oschina.net/u/592116/blog/396102

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!