Suppose we want to programmatically add some element, such as an input field or a button. Question: how to fully customize any XML properties of the added object, such as size, font color, tooltip text (for the input field) and others? I have not found the appropriate method.
In this example, the button and TextView
have been configured for length and width via the LayoutParams
method. But: first, apparently this method is no longer used, and you need to specify a more accurate method, for example RelativeLayout.LayoutParams (I admit that the above may be newbie nonsense, therefore I attach the screenshot below).
Secondly, I cannot set up other XML properties in the same way. How is this done correctly?