-
Notifications
You must be signed in to change notification settings - Fork 37
How to set styles in macroid? #73
Comments
The style can be passed to a view's constructor. There are no other options to use styles programmatically. |
The best approach is to re-write your style as thus:
if on v21+, you can do:
if before v21, you must do: styles.xml:
in code:
However!!! You are attempting to change theme attributes, which is not handled by any of the above (colorControlXXX are theme attributes, you wouldn't be able to apply this in xml via
|
So assuming I wanted to do the following:
Is there any clean way of achieving this using Macroid? Or do I have to manage the EditText using the Android API like in regular Java? |
Ui(new EditText(context, null, R.attr.myEditStyle) <~ tweak On Wed, Feb 3, 2016 at 8:43 PM Abimbola Esuruoso [email protected]
|
That was bloody fast mate.... Thanks, I'll try it! |
IIRC |
I have an EditTextView and I would like to change the style to match the following xml:
However according to this post on StackOverflow setting a style isn't possible programmatically. How can I achieve this in Macroid??
The text was updated successfully, but these errors were encountered: