How to add a image inside a edit text android [duplicate] - android-layout

This question already has answers here:
how to insert image to a editText
(6 answers)
Closed 7 years ago.
I want to add image inside edittext view . For example i have image that size is 250*250 i want to show text left to image for height of 250 after that have to show text in normal left position.
Some text some text some text
Some image Some text some text some text
Some text some text some text
Some text some text some text Some text some
text some text some text some text Some text
some text Some text some text Some text some

You can use the xml property android:drawableLeft or (as mentioned) setCompoundDrawableWithinBounds. But your EditText will look something like this:

You can add image in editext programmatically
using setCompoundDrawableWithinBounds
set drawable at left...

Related

get colored text in pdf file

I have a pdf include some MCQ questions and the right answer is colored and underlined
so I want to extract all the answer from the pdf and put them in the last page
I use pyPDF2 to transport the text from the pdf to a text.txt file
now I want to know how to get words in color or underlined from pdf with python
then I can put them in a list and to what I want
so, what can I use in order to do that ?

Can I select the some specific text from long string and perform action on selected text

You can check this screen short image Basically I want to applying different formats on my text, I just want to select a some text area from long string and apply like bold, underline or some other actions perform on selected text.
Here is a way to highlight text.
Spannable spannable = new SpannableString("A test message");
spannable.setSpan(new BackgroundColorSpan(Color.YELLOW), {start_index), {end_index}, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
textView.setText(spannable);
Here is a post that shows you how to make your text selectable and how to get the start and end index.
Get Selected Text from TextView
This is the reference to using spannable and you can use it to figure out the rest of your text changes to the string. There are many options available.
https://developer.android.com/reference/android/text/style/BackgroundColorSpan

Add hidden data to text file

Is there anyway to add a hidden data to the text file.
For example, in the below text -
Add hidden text to file.
I want the text file to only display -
Add text to file.
But I will still have the hidden word in the document, which I can look at as and when needed.
Got the answer to my question
http://techmeasy.blogspot.com/2013/05/hide-data-text-file-without-software.html

Plain text box with placeholder/prompt text in Android

I want to create plain text, that shows text "Enter here" but greyed out and when you click on the text box, the displayed text disappears, like how when you open a new tab on Google and it shows "Search Google or type a URL".
I have already created the plain text and a button that display the text when you enter it in the plain text.
I tried to search it online, but I don't know what the term is for it.
You're looking for an EditText with a hint property
https://developer.android.com/reference/android/widget/EditText

How to vertically align the text in static text box in PowerBuilder?

How to vertically align the text in static text box in PowerBuilder like the following picture? It can be aligned horizontally to left, center, right. But cannot do the same thing vertically.
Thanks
As far as I know, it cannot be done out of the box.
I have made it anyway "by hand" with the help of the windows API: DrawText(), OffsetRect() and so on to create an improved rounded command button.
You can look at the code in that gist (look at the of_drawtext() method).
Can you explain the purpose of this text box?
Maybe you could use another object where you can easily move your text within.
The text in the box may have a variable number of line?
Do you use sql on the window object?
Maybe put this text between line feed in compute field within the datawindow you used can help you.(Handy Manny's style.....i agree....).
Erf....Seki answered faster
You can use a DW to vertically align a text.
An attribute of the dw static text called "font.escapement" sets the angle at which you want your text displayed.
To display text vertically, set the escapement attribute to 900 (10 * the angle) or to 2700.
Please notice that you will not see the effect in the datawindow painter, you'll have to preview your dw to see if the text is in the correct angle.

Resources