I'm Mihiran Rupasinghe. Today, we'll see how you can customize your application buttons as you wish.
In order to customize your buttons will have to have xml files in "Drawable" folder and images in your "Drawable-hdpi" folder. You can create xml file like this.
1. click the button "Open wizard to help create a new Android XML file".
2. Select 'Drawable' in Resource Type.
3. Select your project and give a suitable name.
4. Select 'selector' for the root element.
Now you have a XML file like this.
You have to modify it like this.
"btnpressed" and "btndefault" are my images (.png) which are in Drawable-hdpi folder. And you can call the xml file in your layout. Coding of my "Sign In" button in Sign In page is shown below. (with my two images buttons)
See you in the next Chapter.
No comments:
Post a Comment