Issue with RelativeLayout when View visibility is View.GONE

后端 未结 8 875
自闭症患者
自闭症患者 2021-02-02 05:11

I\'ve a RelativeLayout thus:



 // <-- View.VISIBLE OR View.GONE

<         


        
8条回答
  •  不知归路
    2021-02-02 05:35

    why not update the below attribute of TextView3 when you update the visibility of TextView2? (I assume you do this in code)

    something like

    TextView tv = (TextView) findViewById(R.id.textview3);
    RelativeLayout.LayoutParams lp =
        (RelativeLayout.LayoutParams) tv.getLayoutParams();
    lp.addRule(RelativeLayout.BELOW, R.id.textview1);
    ((TextView) view).setLayoutParams(lp);
    

提交回复
热议问题