You can set an object’s attribute by specifying the attribute name and value in the object’s tag. For example, the following view tag specifies the width attribute.:
<view width="50"></view>
You can also use the attribute tag to set an attribute. The view tag above can be rewritten as:
<view> <attribute name="width" value="50"/> </view>
Note that you use the name and value attributes inside the attribute tag to specify the name and value of the attribute, respectively. To access and set an attribute from a method, you use the getAttribute and setAttribute methods of the LzNode (See the next section, “The LzNode Class”).