I am trying to add a variable within the class View
, that I can reference in subViews like Button, Label etc.
I have done this successfully in Swift, but having trouble in Java. This is what it looks like in Swift.
This code allows me to set styleName
within all views that extend UIView
. Allowing me to remove redundant custom views. Eg. myButton.styleName = "Hello World"
I have seen that extension
is not possible. As seen here. Not sure if there is another way to achieve this. Thanks in advance!