android知识杂记

1、LayoutInflater 的介绍和用法 http://www.cnblogs.com/androidez/archive/2013/07/01/3164729.html

关键区别就在于 inflate是寻找xml文档对象的,而findViewById是在已知的文档对象上寻找Widget的,比如按钮 文本等

2、LinearLayout.LayoutParams 的介绍和用法  http://blog.csdn.net/liuhaomatou/article/details/22899925

该方法的主要用处就是,xml中设置元素宽高可以用 match_content 等属性,那么在用代码动态添加元素的时候,就是用该方法设置设定元素宽高属性的。
3、android studio 快捷键 ctrl+o 调出可覆写函数列表  Alt + enter 补全implement函数

4、XML中通过android:background方式加载话,内存是始终占用的;建议通过java文件中的OnCreate以及onDestroy中,通过APIs接口进行setBackground进行资源的加载以及释放。

注意:requestWindowFeature(Window.FEATURE_NO_TITLE); 必须放在 setContentView(R.layout.welcome);前面

原文地址:https://www.cnblogs.com/appzhang/p/4746986.html