当前位置: 代码迷 >> Android >> layout_gravity也garvity的区别,该怎么处理
  详细解决方案

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

热度:54   发布时间:2016-05-01 21:54:22.0
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……