Here’s an example of the iPhone EditText control.:

How can I create the same control in Android?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Basically, I see three ways to do what you want.
1st approach:
The first is, as Akki says, make a 9-patch that exactly duplicates the gradient-filled box that you want to use from (unspecified other platform). This lets your app look as close as possible to exactly the same on both platforms.
Here is a 9-patch made from your screen shot above. (This is
res/drawable-*dpi/rounded_text_field.9.png)2nd approach:
The second is to get the same effect using scalable native drawing capabilities. This won’t look exactly the same, but delivers arguably smoother results.
Here is some code to generate a rounded-rect image with a gradient fill. (This is
res/drawable/gradientbg.xml)Actually, I lied. In my original screen shot, the corners are much too big, so I reduced the corner radius from 16dp to 8dp. Here’s what it looks like now. Much improved, don’t you think? And a lot easier than tweaking a bitmap in 4 different densities.
3rd approach:
The third approach is to let the platform be what it will, and look the best that it can within its own paradigm. This has the advantage that, on different versions of the OS, your app will blend seamlessly with the rest of the system, even as the system theme changes.
Here’s the default
EditTextrunning the exact same code on Gingerbread. It would look pretty out of place on a Holo-themed device (such as the Jellybean-powered tablet that I used to create the first screenshot), and vice-versa.For reference, here is the layout that contains all three EditTexts.