Can someone please help me on how can i define an custom attribute of type "string-array" because i cannot find Formats to define array.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="MyCustomWidget">
<attr name="myarray" format="string-array"/>
</declare-styleable>
</resources>
This code doesn't seem to work. What should be my "format"?
A custom attribute is a property that you can define to describe assets. Custom attributes extend the meaning of an asset beyond what you can define with the standard attributes. You can create a custom attribute and assign to it a value that is an integer, a range of integers, or a string.
Custom attributes are attributes that are not part of the standard HTML5 attributes but are explicitly created. They allow us to add our own information to HTML tags. These are not specific and can be used with all the HTML elements.
Attributes are key-value pairs containing information that determines the properties of an event or transaction.
Instead of using
format="string-array"
I used
format="reference"
and referred it to string-array resource.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With