Flex - combined bold and normal label in Button component - apache-flex

It is possible to bold some part of label in standard Button? example:
ICON - normal_normal_text BOLD_BOLD_text
Thanks for help :)

I don't think you can do this with a standard label, but FlexLib contains a CanvasButton component (http://flexlib.googlecode.com/svn/trunk/docs/flexlib/controls/CanvasButton.html) that allows you to add multiple children to a button that would work well to have two labels styled differently, or to better control the styling in a single label.

You're probably better off using a Text or a Label and skinning it look like a button. Each of those has an .htmlText property which will take rudimentary tags like <b></b> and <i></i>, etc. Remember to set the .buttonMode and .useHandCursor properties to true and .mouseChildren to false for best button simulation.

Related

Is there anyway to add a icon in the Entry placeholder?

I can not use a Background Image because cannot fix the position of the start point.the placeholder text is centered.so it is not duplicated.
How to add an icon in the placeholder of an Entry beside using Grid or Layout. Just add it in the placeholder.
I want to make an Entry with placeholder containing an icon . Which is center in the Entry so that I can not use grid or layout to add a Image because this is not the best way.
I think I will have to make clicked event functions of the Image and the entry focus to hide the Image.
The expected result is like that:
Entry
The first way I can think of doing this:
If the icon you would like to use is a generic icon, FontAwesome is a fantastic fontkit that displays icons in the place of text. I have implemented it into Xamarin Forms many times. Here are some tutorials on how to do that:
https://www.wintellect.com/using-fontawesome5-xamarin-forms/
https://doumer.me/icons-with-font-awesome-5-xamarin-forms/
What you would do is set the FontFamily of the entry field to FontAwesome, and then add a textchanged event on text length > 0 change the fontfamily to your normal font, on text length = 0 (Place holder displayed) Change font family to FontAwesome.
The second way I can think of doing this:
Create a Xamarin Forms Custom Renderer for all of the platforms you are using. whereby you will on the native level alter how the Entry field functions to display an icon in its placeholder. To do this you will either need some native expierience on both platforms or some patience and learning about the native platforms.
If you need further help feel free to drop a comment :)

make textbox not to inherit any css

I want to create a textbox to make a loginform. But there is alot of css on it that i don't want to use. Im also using bootstrap so there is a lot of standard css classes and stuff that the textbox inherits. How do i make it not inherit any other classes or can i make it to be reset so that it doesn't have any css classes except the ones i tell i to?!
One of the problems i have is that the textarea looks like it is sunk into the background i rather want it so look flat.
in your CSS
input[type="text"]{border:none; box-shadow:none; width:auto}
you can change any of these properties at will, or apply to all input elements by deleting the [text] part

CSS: Checkbox Styling - fill checkbox with color when checked

I need to change the styling of my checkboxes. I have read many articles on this but what I am expecting is this: http://i.imgur.com/q2HdOJO.png
When checked, instead of the "check", the checkbox be filled with (in this case) blue color.
I am not sure if this is the "intermediate" state in Mac and thus looks different in my Ubuntu machine but how can I fill the checkbox with color?
You can use the accent-color property in CSS:
#checkbox {
accent-color: #00FFF0;
}
Use images and bind click events with Javascript. It will be much easier than trying to use CSS. CSS will be impossible in some browsers that don't support the styling to hope to achieve.
Here is a related post: How to use images for check boxes using CSS or may be Javascript?

How can a spark Label be skinned?

I would like to add some fancy drawing beyond the CSS formatting.
How can I put a skin on a spark Label ?
thanks
Wow, +1 for a good question. The approach I would take would be to custom component that wraps a Label with a SkinnableComponent, which then allows you to specify a skin class since the Label component itself is not skinnable. I would then take a look at the Button and ButtonSkin classes to mimic passing the label text into the Label component in your skin. Hope that helps.

Flex LinkBar: how to set a selected button's background color?

I was able to set the text color of a selected LinkBar button by "disabledColor" style of LinkBar. Accordingly, I expect to set the background color of the selected button by "backgroundDisabledColor" style, however, it didn't work; and except "backgroundDisabledColor", I didn't see any other style that could possibly achieve this. Please help. Thanks.
The problem is probably that you're setting the style on the LinkBar itself - try setting the LinkBar's linkButtonStyleName style to a different style selector that contains all of the styles you need for your button. You should be able to set the fillColors style of the buttons themselves there - this will change the default look of the button.
If you need to adjust the "selected" color or if you need something more advanced than just skinning the button background you'll need to write a custom skin class. This isn't too difficult - the Button class has a whole set of "Selected" styles - selectedDownSkin, selectedUpSkin, selectedDisabledSkin, etc. IMO the best practice is to set your button skin to a custom skin class that sets the different individual styles based on state.
David Flately illustrates this method here. Check out his source - that should get you what you need. A good book on this topic that has this sort of thing along with lots of other examples is Juan Sanchez and Andy McIntosh's Creating Visual Experiences with Flex 3.0. I can't post a link to it because my reputation isn't high enough here yet, but you can find it on amazon or barnes and noble or any other online bookstore.
FYI - answer here....
http://dezeloper.wordpress.com/2010/02/24/flex-css-linkbar-togglebuttonbar-selected-text-color/
Haha, was looking for same thing, you can see on the source code of LinkBar:
// Hilite the new selection.
child = Button(getChildAt(selectedIndex));
child.enabled = false;
Which is clever!!! Rather than set selected to true, they disable the selected button ... why not ;-( Took me half an hour to understand the Flex team logical ...
eBuildy, Flex Specialists

Resources