Procurares
Procurares

Reputation: 2249

Specific EditText Android

I'm new at Android, and almost haven't any work with EditText view, but still i received image with some EditText that i must use.

Image Received with som EditText

I saw some similar EditText in custom dialog from official Android developer page (Figure 5).

As you can see, there are some underlines, in each EditText.

First i thought, that EditText, with such underline, is default View. But when i tried to make such EditText component, i faced problem, that default EditText haven't any underlines, and it's just a simple rectangle, without any images inside... I tried to make this component another background (creating selector xml file), setting some background image... Nothing works.

Please, give me advice: How to make such EditBox with underline, and that image above that EditText.

P.S. I'm using 10 API Level (2.3.3) with support library to work with fragments.

P.S.S. Sorry for little information. I'm new at Stackoverflow, and can't post Images, and more than 2 Hyperlinks...

Upvotes: 5

Views: 579

Answers (2)

Procurares
Procurares

Reputation: 2249

I solved my problem!

As burmat told me, I created some nine-patch image with a simple orange underline. Then I inserted my EditText in a Relative Layout. Then inserted the image I needed.

The result was exactly what I wanted!

Upvotes: 0

burmat
burmat

Reputation: 2548

Use a higher API Level and your EditText will look like that by default (given you are using the theme for it. Try to load your application in with API level 4.0 (14) or 4.0.3 (15) and take a look.

Also, check out this site (specifically this for widgets). You can get a sense of what graphics and backgrounds are used. You should be able to download and apply these backgrounds using basic styling techniques without major difficulty.

Upvotes: 1

Related Questions