Change linear layout top margin programmatically android

后端 未结 7 1087
难免孤独
难免孤独 2021-02-01 02:31

i have two linear layouts in one frame layout.



        
7条回答
  •  借酒劲吻你
    2021-02-01 03:21

       layout = (LinearLayout) findViewById(R.id.layoutbtnlinear_aboutme);
       LinearLayout.LayoutParams params = (LinearLayout.LayoutParams)layout.getLayoutParams();
       params.setMargins(0, 50, 0, 0); 
       layout.setLayoutParams(params);
    

提交回复
热议问题