Rounded button button for Android
This article describes the implementation process of rounded button button in Android development, which is shared for your reference. The specific contents are as follows
Requirements and renderings:
Implementation idea:
1. Shape rounded
Create two new XML files in drawable. These two XML files realize the fillet effect with shape.
Note: in order to make users have the effect experience of pressing, there should be two sets of fillet diagrams, which can be switched when pressing
2. The selector implements the pressing effect
Create a new XML file in drawable and organize the two XML files just created with selector
3. Style to reuse multiple buttons
Enter the following code in RES / values / styles. XML
4. Reference fillet button
In layout / fragment_ Style reference is used in bob.xml
You can omit the steps of creating a style and directly reference it in the layout.
The above is the whole content of this article. I hope it will be helpful for everyone to learn Android.