[Android学习系列6]一些xml布局的小技巧

宽高为0时,layout_weight表示比例

宽高为fill_parent时,layout_weight表示渲染优先级  越小越优先

 

 

android:输入法遮挡问题的解决方法

http://blog.csdn.net/uyu2yiyi/article/details/6329738

 

利用drawable的   shape  为   linearlayout设置边框

参考:  http://blog.csdn.net/yuxiaohui78/article/details/8274067

 

 

Android中的Selector的用法

http://blog.csdn.net/shakespeare001/article/details/7788400

 

 

shapeselector的结合使用

http://liangruijun.blog.51cto.com/3061169/732310

如果是为linearlayout添加selector,记得加上android:clickable="true"

http://blog.csdn.net/liangguo03/article/details/7392281

 

 

去除标题栏

http://www.cnblogs.com/and_he/archive/2011/06/01/2067106.html

  

取消edittext的自动聚焦

http://li-bonan.blog.163.com/blog/static/135564770201182611743759/

 

 

 

更改linearlayout背景色

LinearLayout 不要用findviewbyid来实例化,用下面代码试试看可行:
LayoutInflater layoutInflater = (LayoutInflater) getSystemService(Activity.LAYOUT_INFLATER_SERVICE) ;
LinearLayout ll = (LinearLayout) layoutInflater.inflate(R.layout.main, null) ;        

setContentView(parentLinearLayout);
ll.setBackgroundColor(Color.BLUE);

http://www.eoeandroid.com/thread-114709-1-1.html

posted @ 2014-04-22 20:53  粪粪滔  阅读(229)  评论(0编辑  收藏  举报