How to set margin dynamically in Android?

后端 未结 5 2057
甜味超标
甜味超标 2020-12-25 11:19

I am currently doing an android application that contains customize alert dialog. It contains a button , but i can\'t set the margin for the button . the code is given belo

5条回答
  •  再見小時候
    2020-12-25 11:34

    The setMargin() method is available if you're using LinearLayout.LayoutParams but not if you're using ViewGroup.LayoutParams. Dipak Keshariya alludes to this but doesn't say it in so many words.

提交回复
热议问题