Check Mobile App
Read now
Start a Project

Android Custom View


‘sup developers. Today we are going to create a custom view class that will add certain fuctionality in our application.

In magento, to express a field to be required, magento by default add a ‘*’ in front of it.




To add this functionality, normally we write some boring code. Why can we do like this:



and we get the same functionality



Yes, this possible. Here comes our CUSTOM VIEWS

What we have to do in order to create custom view.


Step1. Declare a styleable and add attribute that we want to show in our xml (custom view)

Step 2. Create Custom View Class

Step3. Access custom view in Layout XML.

Note: Don’t forget to use namespace. For gradle project use this: 

Custom Views plays an important role. They not only makes the work easier but they SAVE OUR LIFEs.


That’s all folk’s Stay tuned!!!

. . .

Leave a Comment

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

Be the first to comment.


When I think in getting solutions for my Ecommerce Platform, I think of Webkul. They have been such a blessing in our business. We have spent thousands of dollars in support and modules from them. We love their support team. They work very closely with us, and they always go the extra mile when we need help.

Michael Urresta

Michael Urresta

Talk to Sales


Live Chat
Start a Project

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home