how can I get the properties of an existing view and use it for a dynamic view?

353 views Asked by At

I have a .xml file(picture below). In my .xml, the second row's views create while running.

I want my new created views get the same properties from the existing views, like textsize, maxlenght, text-alighn , etc

I tried to change the things that I set for first row views in xml, but some of my codes don't work. for example, this line:

            b2.setTextSize(b.getTextSize());

doesn't change the TextSize of the second Button.

what can I do?

enter image description here

Edit: Is there a function that could be able to get the whole attributes together and set them for new views?

0

There are 0 answers