Galax
Galax

Reputation: 365

EditText XML Design

I'm looking to create an EditText that looks like the following & was just wondering if it was possible & if anybody might be able to provide example XML code to create the following.

Note: The cursor doesn't have to be blue, if it can be that's cool, but definitely not required.

enter image description here

Upvotes: 0

Views: 85

Answers (1)

Booger
Booger

Reputation: 18725

This is just an EditText with a custom background (the underline with the curved shape). You would just use a standard EditText, and add your custom drawable (however you make that - either a PNG, 9Patch, ShapeDrawable, etc) as the "background" element. The text label would just be a TextView you put in your layout above the EditText.

However, I would steer you to use the new "TextInputLayout" provided in the Design Support Lib. This has a ton of built in functionality, and as a bonus, your app will be consistent with Material Design standards.

Upvotes: 2

Related Questions