How can I personalize my textView? - android

Yesterday I asked a question about the TextView. I read and I see that it's very difficult to understand. So, I'm sorry.
Now I explain better my problem:
I try to personalize my TextView. I tried two different things:
I use photoshop, I made an image text and I use it as a drawable. The image re-sized isn't with right quality
I try to use the text of TextView, but I can't change the family of the text (the app crashed). Then I don't know how to set gradient as text color and border in the text.
What can I do?
Edit: yes! For the point 1 I use an ImageView inside of TextView. In point 2 I use TextView. I have problem in both situation!

I think to customize textview (any view) you have to implement your own custom view by creating your custom class.
Here is link for custom text view,i hope i will find it useful
http://www.jayway.com/2012/06/25/creating-custom-android-views-part-1-extending-standard-views-and-adding-new-xml-attributes/

Related

Android - how to integrate text into image

I want to create an Activity in my app that has an image chosen by the user and two or more EditTexts below said image where the user writes something.
After that, text from those EditTexts should be "integrated" into that image, let's say one on the top and one on the bottom of the image. I wrote integrated because I want the text to be a part of the image - those two need to become only one image so I can use an intent to send it to someone's email.
Sorry if the question is badly asked, I just didn't know how to formulate what I wan so I hope you got it.
Please follow steps
Create one framelayout with TextView and ImageView
Put EditText box implement TextWatcher
In onTextChanged method of textwatcher set text in textview.
You can create Bitmap of framelayout
Sounds like you are looking for ViewOverlay
The first example in this link does exactly what you want to do.
http://flavienlaurent.com/blog/2013/08/14/viewoverlay-when-how-and-for-what-purpose/
Have you tried using a custom/compound view?

Android, Simple box inside a button?

I want to have a button like the one in the link below. How can i achieve it just by java code or xml? By the way it's going to be of a different color when pressed. I've explored similar posts but none helped. Any help appreciated.
The button which i want
Just make a View with large rectangle and add what you want(e.g. Label contains 'Number Of Students' and/or something else) in the view.
Then, add onClickListener to the View.
To change clicked colour, refer to here

android: how can i create a TextView combining icom?

is there an easy way to create a text view with an icon inside the text?
like in this number of rates example:
(** 3,45642)
(I have less then reputeshion 10 so I cant insert the image I wanted
** means an icon of a small man)
or is it part of RatingBar that i couldn't find?
I don't want to use android:drawableLeft="#drawable/my_icon"
as i feel like the parenthesis are critical.
Many thanks for any help!
Check out SpannableStringBuilder class.
Usage examples are posted here:
http://www.programcreek.com/java-api-examples/index.php?api=android.text.SpannableStringBuilder

Fill with Color on Android

I have an image which include 10 boxes on my image view. When I click the one of boxes I want to change color of box (fill with color). How do I do that? Should I use Surface View or something else?
Update:
I found a solution. But if I use AsyncTask the code does not work. If I use a normal class the code works. I do not know why but I think problem is related with invalidate().

How to draw borders for TextView created using Code not by XML in Android

I created my TextView through code rather than XML. I want to draw a border around the TextView.How can we do this using code rather than XML? I also wanted when I try to setText for the TextView which is of some 2 lines then TextView is moving downward? plz also guide me to solve this problem.
I will be waititng for reply .
Regarda,
Probably the easiest way to get a nice border to your text view would be to create a 9-patch image and set it as background to your text field. Just get padding right in your image and you have a border for your text view
I don't really understand your second question. Would setting your text field as a single line help?
link to TextView API

Categories

Resources