how to set EditText TopMargins in dp programatically?

Viewed 18839

In my android application I want to change the topMargin of an editText.

The thing is that I want to change it "dp" wise and not pixel wise.

I want to change only the topMaring. Leave the other as is. not set them to zeros ?

programmatically i can set margins in int only?

4 Answers
Related