Dual colour in one label in flex 3 - flex3

I was just wondering if you can get two colours in a label so i can have some of the text white and some red. I have been looking online and have not found anything. However, I though here would be a more appropriate place to ask. If not i will just use two labels. But any input is appreciated.
Regards
Mark

I seriously doubt that's possible.

Related

How to create legends with triangular end boxes in arcGIS?

I simply want my legend which is now in the form of the left bar in the following image, to be shown in the form of the bar in the right side. I couldn't find anything related for arcGIS. those anyone know?
Thank you so much for your help.
Unfortunately I don't think there is an elegant way to do this, only a work-around:
In Layout View, convert the legend to graphics. (Make sure your data and legend are in their final product state as your legend will no longer be dynamically linked to your data).
Right-click on the legend and ungroup the elements in the legend. Repeat as many times as necessary in order to be able to select an individual rectangle.
Manually convert the two rectangles into triangles. One way to do this would be to activate the "Draw" toolbar and draw white polygons over parts of each rectangle.
Once finished, regroup everything.
Again, not the prettiest solution but I don't believe ArcMap has this functionality.
Good luck!
Tom

UITextView with red color for odd lines and blue for even lines(UITextView with diffrent colors)

I want to show some texts in my application. There are some articles in two languages. For each article, odd paragraphs are comments in first language and even paragraphs are translated comments. Actually it is one of the limits for the specific app that both languages should be available in the same page. Language A should be red and language B should be with blue color.
Is it possible for me to use one UITextView and set different colors for different paragraphs?
I have seen a few topics about text views with multiple colors but none of them were clear enough and I could not find any other helpful posts.
Is it possible for me to use one UITextView and set different colors for different paragraphs
Yes, it is perfectly possible. Here's some sample code of mine:
https://github.com/mattneub/Programming-iOS-Book-Examples/blob/master/bk2ch10p503attributedString/ch23p771attributedStringInLabel/ViewController.m
In that code (set which to 4, I think), we create two paragraphs with two different styles and two different colors, and draw them in a label and a text view.
Attributed text is what you're looking for, see here: http://www.ioscreator.com/tutorials/format-text-in-ios6-attributed-strings
NSAttributedStrings are the tool for the job. They are strings that are specially designed for your user interface, and with that come some special capabilities. You can access the attributed string of your UITextView through its attributedText property.
NSAttributedString *attStr = myTextView.attributedText;
Once you have acess to this, you can start messing around with the colors. To do this, you have to apply a special attribute to a certain range.
[myTextView.attributedText addAttribute:NSForegroundColorAttributeName
value:<firstParagraphColor>
range:<firstParagraphRange>];
[myTextView.attributedText addAttribute:NSForegroundColorAttributeName
value:<secondParagraphColor>
range:<secondParagraphRange>];

Remove margin on a label on 2 lines?

I just have a little graphic issue, i have a label which contain a text on 2 lines but there is an horrible margin, like 10px ...
Is there an solution for removing or reducing this marging ?
have i to use web view for use css ? :/
Thanks,
I'm afraid there isn't an easy solution.
You could try some of the tips presented here: http://www.iphonedevsdk.com/forum/iphone-sdk-development/14178-spacing-between-lines-multiline-uilabel.html#
or break your label into two different labels or use an uiwebview.
Anyway, excepting the case where you have a localized label, with dynamic text based on an xml, just use two different labels for each line and place them as you please

Colored substring in UITextField

I would like to change the color only of particular substrings (keywords) while the user is typing in a UITextField.
In the documentation I saw the property textColor but it does change the color of the entire text string, while I would like to highlight only some keywords.
Is it possible?
The short answer is no.
It's possible if you create your own textfield from scratch using NSAttributedStrings and CATextLayers or Core Text, but this is an incredibly complex and difficult problem.
If you are mirroring what the user types in a preview box of some sort it is possible to create multiple labels or text fields that stay next to each other and have different colors or fonts or whatever. Otherwise, I'm afraid Nick's answer is accurate - within a single textField it ain't happening.
Good luck,
Damien

Removing White Background Box from MATLAB Figure when using the Mapping Toolbox

I've started to use the Mapping Toolbox in MATLAB for a project of mine, and below is a screenshot of what I currently have created using it.
What I'm trying to do now is remove the white box from behind the actual map, but I can't seem to figure out how to do it. I've trying setting 'Frame' to 'off' with the axesm command when first creating the map, but that doesn't do it. I've looked through the documentation to try to figure out why there's even a white background (and when I use the worldmap command the box doesn't appear), but I cannot determine why.
EDIT: I am looking to remove the white background entirely, so as to have the main contour plot surrounded by the figure's background color, which in this case is the gray.
The background color of a figure is a property of that figure named 'color'.
If you set that property to the value 'none' then you will have no background.
So, the easiest way to do it is:
set(gca,'color','none')
Of course you can give a figure handle instead of the current axes (gca).
The more aggressive option is to set the entire axis off:
axis off
But this will remove the axis completely, including labels and such which might not be what you want.
Try axis off when it's in focus, axis(handle,'off') when not
I have a potential solution.
If you run
get(figure(1))
to find the figure attributes and run
set('some resize property',[some set of values])
or
setm('some resize property',[some set of values])
You may be able to 'fill in' the space this way, unless there is an easier property to change. Can you please give more details if this does not lead to a solution?
Hope this helps!