牟骏荣博客


  • 首页

  • 安卓学习

  • Linux学习

  • 前端

  • 服务端

  • Python

Android LinearLayout动态增加item时Weight的设置

Posted on 2018-09-14 | In 安卓

Android LinearLayout动态增加item时Weight的设置即可。

  • child item可以从xml中直接inflate出来。

  • 这里有个问题是,动态增加的话,child item中的weight,在add到LinearLayout后无效(用LinearLayout,很多时候就是冲着weight去的,因为可以很容易做到对齐和分割)。

  • 唯一的办法是在addView的时候用新的LayoutParams来指定weight:

addView

1
addView(child, new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT, 1));
  • Android的layout配置中,类似的坑数不尽。。。再加上不同OS版本的不同表现,简直了T_T。。
    1
    setWeightSum(childCount);

28种纯css3动态加载loading动态特效

Posted on 2018-09-14 | In 前端
  • 28种纯css3动态加载loading动态特效

案例地址

28种纯css3动态加载loading动态特效

1…56

牟骏荣

52 posts
11 categories
57 tags
loading css3 动态特效 android View angular drawable dom Scroll 鼠标拖动 express nodejs git 前端 ubuntu linux ionic relativelayout 相对布局 VSCode webview RecyclerView javascript nginx ueditor nodeJs shell chrome gitee VUE linearlayout 瀑布流 实例 php GPS 工具类 mongodb 百度地图 demo echart 图标 资源 Promise python 爬虫 webstorm js django sql 正则表达式 mongo intput 预览图片 验证码 close phone scroll
© 2019 牟骏荣