I am building a custom view and trying to figure out how to integrate it with the gui layout editor in eclipse. I have added the code below to my constuctor.
public baseGrid(Context context, AttributeSet attrs) {
super(context, attrs);
if (attrs.getAttributeValue(null, "bufferTop") != null)
bufferTop = Integer.parseInt(attrs.getAttributeValue(null, "bufferTop"));
...
and it works to read this xml attribute (… bufferTop="10" …) from the xml layout file. However, is there a way to get bufferTop to show up in the GUI Property Editor as a property that I can set without editting the XML?
Thanks
Try to add “attrs.xml” file to “res/values” folder.
Read by this code:
Define widgets in this way: