[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

转载于:https://www.cnblogs.com/sleeptothedeath/p/3681427.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值