首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

layout_gravity也garvity的区别,该怎么处理

2012-03-26 
layout_gravity也garvity的区别求android高手layout_gravity也garvity的区别??谢谢[解决办法]你可以这样看

layout_gravity也garvity的区别
求android高手  
layout_gravity也garvity的区别??
谢谢

[解决办法]
你可以这样看,layout_gravity是指控件的布局位置,比如Button、ImageView等。而gravity貌似是指控件中的文字、图片等得位置吧。比如Button上的文字。
[解决办法]
android:gravity是对元素本身 //Specifies how to place the content of an object, both on the x- and y-axis, within the object itself. 
http://developer.android.com/reference/android/widget/LinearLayout.LayoutParams.html#gravity

android:layout_gravity是相对与它的父元素//Standard gravity constant that a child can supply to its parent. 
http://developer.android.com/reference/android/widget/LinearLayout.LayoutParams.html#attr_android:layout_gravity





[解决办法]

探讨

android:gravity是对元素本身 //Specifies how to place the content of an object, both on the x- and y-axis, within the object itself.
http://developer.android.com/reference/android/widget/LinearLayout.Layo……

[解决办法]
探讨
android:gravity是对元素本身 //Specifies how to place the content of an object, both on the x- and y-axis, within the object itself.
http://developer.android.com/reference/android/widget/LinearLayout.Layou……

热点排行