Android Programming -4 Button Component

Hi guys in this tutorial  I will talk about button component.

In my previous tutorial, I mentioned the textview and edittext components. If you have not read it yet, I recommend you read it first.

If we go through the login page, when user enters user name and password with edittexts, we need check the correctness of the entered password. Because according to this result, either the user will login to the application and access the data or login to the wrong password error. Therefore, it is very important that this control mechanism works correctly.

It is as important as when this control structure will work correctly.

    android:orientation="vertical" >


     android: text_color="#ffff"
     android:text="Giriş Yap" /> 


Height, weight and id variables, which are common to all components, are defined. The following set of features is entirely for the design of the page.

For example, my design is at the bottom and in the middle of the page. The color is green and the text on it is black. But your design is below the button textview in 20 dp, 40 dp margins from left and right and Color can be purple and text color can be white.

As you can see, the features we set depend entirely on the design. For this example, android: layout_centerInParent = ”True” feature in the middle of the page we have made the button.



About Kübra Hebeş

Bilgisayar Mühendisi

Leave a Reply

Your email address will not be published. Required fields are marked *