Change Relative layout width and height dynamically

后端 未结 7 1147
眼角桃花
眼角桃花 2020-12-14 09:30

Hi i am using following layout structure inside LinearLayout



        
7条回答
  •  天涯浪人
    2020-12-14 09:43

    If you intending to change Height, then this would make a trick.

    RelativeLayout relativeLayout = (RelativeLayout) findViewById(R.id.yourId);
    relativeLayout.getLayoutParams().height = 100;
    relativeLayout.getLayoutParams().width = 100;
    

提交回复
热议问题