ViewGroup.MarginLayoutParams

android:layout_marginBottom

android:layout_marginLeft

android:layout_marginRight

android:layout_marginTop

=====================================

ViewGroup.LayoutParams

android:layout_height

android:layout_width

=====================================

FrameLayout.LayoutParams

[ViewGroup.MarginLayoutParams]

[ViewGroup.LayoutParams]

=====================================

AbsoluteLayout.LayoutParams

[ViewGroup.LayoutParams]

layout_x

layout_y

=====================================

LinearLayout.LayoutParams

[ViewGroup.MarginLayoutParams]

[ViewGroup.LayoutParams]

android:layout_gravity

android:layout_weight

=====================================

RelativeLayout.LayoutParams

[android.view.ViewGroup.MarginLayoutParams]

[android.view.ViewGroup.LayoutParams]

android:layout_above

android:layout_alignBaseline

android:layout_alignBottom

android:layout_alignLeft

android:layout_alignParentBottom

android:layout_alignParentLeft

android:layout_alignParentRight

android:layout_alignParentTop

android:layout_alignRight

android:layout_alignTop

android:layout_alignWithParentIfMissing

android:layout_below

android:layout_centerHorizontal

android:layout_centerInParent

android:layout_centerVertical

android:layout_toLeftOf

android:layout_toRightOf





以上,[...]表示继承关系



以上,罗列了各布局下的可用参数。



控件的布局不同,体现在xml文件中,其可用的参数(param)也有差异,且其子控件(写在该布局下的控件)。



比如,同样是TextView,当布局为LinearLayout时,它的可用的layout参数有9种,而布局为AbsoluteLayout时,它的可用的layout参数只有4种。(当然不同版本的sdk可能会有所差异)。



甚至LinearLayout和AbsoluteLayout内幕就没有相同的layout属性。



他们之间的比较可以查看附件里的图片,相信大家都会一目了然。



布局应用中控件里几乎无处不在,了解什么情况下用什么布局及布局属性,还是很有必要的。

所以,如果在布局不同的情况下,直接进行复制子控件操作很有可能出问题。

更多相关文章

  1. Android的Layout及其Param
  2. android 控件属性 116
  3. Python常见内置高阶函数即高阶函数用法
  4. Android自定义实现日历控件
  5. 看看函数库
  6. RabbitMQ 高可用之如何确保消息成功消费
  7. 解构赋值 、函数参数中使用解构的方式、 dom元素的增删改查、 da
  8. js语法:数据类型、函数,作用域/作用域链、闭包
  9. 【前端】如何向requestAnimationFrame的回调函数中传递参数

随机推荐

  1. Android的消息机制,用Android线程间通信的
  2. Android自定义视图四:定制onMeasure强制显
  3. Android上的Back键事件捕获
  4. 自定义VIEW③Canvas
  5. Android的多任务之路
  6. 利用HTML5开发Android笔记
  7. android进程创建分析
  8. [转]快速切换Android工程版本的方法
  9. Android的init过程详解(一)
  10. Android(安卓)内存浅析【管理、机制、分