We usually think that the buttons provided by the system are not beautiful enough. At this time, we can define a button by ourselves to meet our own needs. Here we can implement a rounded button. You need to create an xml file in the drawable folder and use shape as the root label. You can use the following shape to achieve the requirement: [html] <? Xml version = "1.0" encoding = "UTF-8"?> <Shape xmlns: android = "http://schemas.android.com/apk/res/android" android: shape = "rectangle"> <! -- Fill color (white) --> <solid android: color = "# 0000FF"/> <! -- Set the four corners of the button to an arc --> <! -- Android: radius arc radius --> <corners android: radius = "5dip"/> <! -- Padding: The interval between the text in the Button and the Button boundary --> <padding android: left = "10dp" android: top = "10dp" android: right = "10dp" android: bottom = "10dp"/> </shape> at the same time, you must add the following code to the Button tag in the layout file for declaration: [html] android: under background = "@ drawable/shape", I want to draw a straight line in the Activity, which is easy to implement. I only need to use View as the root label and set the height to 1 px, the following is an implementation statement: [html] <View android: layout_height = "1px" android: background = "# ff0000" android: layout_width = "fill_parent"> </View> is implemented: