We all know that we can set text on the android.widget.Button. But we can add images to the android.widget.Button also. We can even specify the location of the image relative to the text on the button, such as on top, bottom, left, and right to the text. This article will show you an example of …
android.widget.ImageButton is used to create a button with image in android app. It is similar with android Button object. You can also set an onClickListener to it to process button click event. But ImageButton do not has text property, if you want to display both text and image in a button, you need to use …
This example will show you how to use the android.widget.TableLayout and android.widget.Button to implement an android calculator application. It is a regular calculator which can execute +, –, *, and / operation.
The android.widget.Button is a frequently used widget in the android application. You can add as many buttons as you need in a layout view object. But how to listen and respond to the click event when the user clicks the buttons? This example will tell you how.
This article will show you two examples. One is a Tab example which is implemented by an android selector and layer-list drawable object. The other is a shadow button implemented by layer-list.
This example will show you how to use an android selector drawable resource to make a button to show different background colors in different button states(disable, pressed, unpressed).