I have many custom buttons in my layout xml. And each of that button has property i.e width. Can I create one xml for that custom button with defines width property?
2 Answers
You can create Attribute Resources for your custom views(for example buttons).create a new file in your project "res/values" folder by selecting it and choosing "File", "New", "File". Enter "attrs.xml" as the file.Then declare-styleable for your view.Now you can use them in XML layout when add your view to layout.You can see more details here.