美文网首页
LayoutParams

LayoutParams

作者: Alan龙马 | 来源:发表于2019-12-09 13:33 被阅读0次

    动态修改view 高度

    int height = (int) context.getResources().getDimension(R.dimen.DIMEN_100dp);
    
    public static void setHeight(View view, int nHeight) {
            ViewGroup.LayoutParams lp = view.getLayoutParams();
            if (lp.height != nHeight ) {
                lp.height = nHeight;
                view.setLayoutParams(lp);
            }
        }
    

    https://blog.csdn.net/meixi_android/article/details/78019444

    相关文章

      网友评论

          本文标题:LayoutParams

          本文链接:https://www.haomeiwen.com/subject/flpbgctx.html