I am working on android frameworks. I need to modify the shape of the textview such that it should have rounded corners. Can you please help me with this issue?
Share
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.
XML file saved at res/drawable/gradient_box.xml:
This layout XML applies the shape drawable to a View:
This application code gets the shape drawable and applies it to a View:
Resources res = getResources();
Drawable shape = res. getDrawable(R.drawable.gradient_box);
Copy&Paste from http://developer.android.com/guide/topics/resources/drawable-resource.html, first result when you google “android textView rounded corners”
[EDIT]
As you want to change the source of the android framework, you can alter the style of the TextView by altering the default Drawables. In the sources the various Drawables are grouped in an inner class called Drawables:
Just alter these Drawables as you like and you have redefined TextView.
I’m referring to that version of the TextView sources.