Replace keywords by images in TextField - actionscript

I have some textfield with text like "Click #button1, then #button2". Have you got any idea how to replace keywords by images ? I must do it in AS2 :/ I know there is htmlText in textField, but useing it I can only use one image, and image can only align left or right site.

Very advanced stuff. I can tell you there is no 'out of the box' solution like using html text fields or something similar. Especially if you want to mimic nearly html behaviour you have to code advanced routines that can : 1. recognize your keywords. You should google for tokenizers and 2. layout textfields according to occuring images and textblocks. Again, thats advanced!

Related

Create edittext like stackoverflow tag text box

I want to create a multi lined edit text that can hold buttons but also have the ability to add free form text.
It should behave like the tag text box of stackoverflow that is under the body of the question when you ask a question on stackoverflow.
I thought about one layout that holds buttons (e.g. tags) and an edit text right after said layout. But as I want it to be multi-lined and if there was a line break, I'm not sure how the edit text should behave, since it couldn't be a quadratic box anymore.
Can you point me in the right direction? I've seen a post about making parts of an edittext uneditable. I could do this and put buttons over it, but the buttons might be a little bigger than the underlying text.
Do you know of alternatives?
I hope you get the point, if not I'll draw the control.
You can achieve same by using FlowLayout. Keep on adding text/button view it will automatically wraps contents to next line

is there any way to Underline some text of UILabel and make it Clickable?

I have following text in UILabel. I want to underline both text. and give them click event and open related link.
I Agree to the Terms & Conditions and Hotel Booking and Cancellation Policies
but problem is I couldn't give separate click event for both underlined text.
What is the best way to do that?
I know one option give separate label for all four string. but it is harder to maintain position of all that label for different sizes
Appreciate for help!!!!
take a look of this library Might be it will help you: https://github.com/TTTAttributedLabel/TTTAttributedLabel
Suggest to change the UI design. A possible work around I found is add UILabel below this text label/button with text contains a number of under scores(_) and pin it with auto layout. N.B: It's never ever a good practice at all.

Creating a signup form using a tableview in xcode (like SnapChat)

I am looking to improve my app's signup and login form from standard text boxes to using table rows (or something similar).
I am pretty much inspired by the forms which SnapChat have created, which you can see below...
I'm trying to figure out how they accomplished this, and am thinking it must be a table view with 3 cells (Static?), and the text below is part of the footer of that selection of cells.
How is one able to then capture data into it directly?
Am I right in maybe assuming that each cell is 'custom' with a text field in each one (with placeholder text) with a no-borders style on the text field?
Or has this been achieved via some other way?
Keen to hear your thoughts. Thanks!
You absolutely could do that with a table view. But I don't think this one is. Notice the divider lines start at the far left rather than at 15 pixels in (with the text). The separator lines are also two pixels tall rather than one. So I'd say it's a safe bet that it's just a simple view with 1 pixel tall UIView's for lines.

Getting view with liquid buttons

Consider that we have a formula: buttona texta buttonb textb buttonc textc buttond text. Fixed number of buttons (each of which has different length of course) and possibly dynamic number of text labels.
What is the most easiest way to get a UIView with liquid buttons as well as text labels based on that? Please, see an example.
Of course we can find a correlation with html displaying. Perhaps we have existing components to do that?
You may achieve this using NSAttributedString class. Check this link for examples.

nsISelectionDisplay custom highlight controller? (related to nsISelectionController)

I made an addon HiliteOnSelection, when hilight something it uses the SELECTION_FIND context to highlight other instances. The issue with this is that highlight all feature of find bar uses same controller.
http://mxr.mozilla.org/mozilla-release/source/content/base/public/nsISelectionController.idl#30
Can you please help me to figure out how to create my custom highlight controller and how to style it, the SELECTION_FIND is pink.
This is how i get the selection_find context/controller and highlight with it:
https://addons.mozilla.org/en-US/firefox/files/browse/247620/file/bootstrap.js#L147
let findSelection = controller.getSelection(Ci.nsISelectionController.SELECTION_FIND);
findSelection.addRange(aRange);
I got this reply from the addon author. He's a nice guy:
Hey Noitidart,
You might find this one helpful:
https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsISelectionController
I'm hardly the master you think I am, actually. :) To change those
colors I just change the values for preferences:
ui.textHighlightBackground ui.textHighlightForeground
ui.textSelectBackgroundAttention -> SELECTION_ATTENTION, it's not a
highlight, it's a normal selection (as you would select some text with
your mouse and it would turn the regular blue blackground, in windows
at least) but it's given "attention", so it has the green background
that the find operation reports. Basically it's a way of showing the
user "Here I am!!" after firefox automatically selecs the text he
searched for.
And I really don't know most of those contants, SELECTION_NORMAL is
for normal text selection, like it would be when you select text with
your mouse, SELECTION_FIND is for the highlights, and I only know the
ON/HIDDEN/OFF/DISABLED ones which are self-explanatory.
SELECTION_SPELLCHECK is probably for the auto-correct when you are
typing in an editable content node, but I'm just guessing that one
from the name.
Also, as far as I know, it's not possible to just create custom
selection ranges/contants, as the code simply won't recognize them
without editing the C++ code as well. Which is actually one of the
reasons I haven't implemented
https://github.com/Quicksaver/FindBar-Tweak/issues/76 yet.
Hope any of this helps. I'm sorry to disappoint on the custom
controller thing.
Luís Miguel
So he changes the colors with a simple pref change. I'm going to have to dig into how that pref changes it.
He also thinks its not possible to create custom controllers without C++, I hope this is not true I'll keep digging if anyone can help that would be great.

Resources