Every time I compile a MXML file, I get a SWF file. When I load the SWF file to the browser, all the space outside the SWF file is this gray gradient.
I want to change the color, or make it disappear entirely, however, when I search for "Flex background color" I get information to do other things.
How do I get rid of that?
Add the following to thr compiler arguments:
-default-background-color #222222
Where color is the color you like.
To change background color of SWF itself change values of Application tag. For MX Application refer to the documentation and take a look at backgroundGradientAlphas and backgroundGradientColors styles.
For Spark Application documentation is here.
Related
I want to use animated GIF in my Gtk3 application. I know this can be done by assigning GdkPixbufAnimation to the Gtk.Image component, but this approach requires the animation file name to be referenced directly from the source code.
Is it possible to specify the animation file in CSS, like "normal" background image? I tried to set the animated GIF as background-image property of Gtk.Image and Gtk.Label components, but the image is displayed statically.
I am designing my app UI with the GUI Builder. I created a new Form and defined a style as follow :
FinishFlagIcon {
background-image: url(pics/FinishFlag.png);
cn1-background-type: cn1-image-scaled-fit;
cn1-source-dpi: 320;
font-size: 11.9mm;
}
I set this style on a label and it appears on the GUI Builder.
However when I launch the project in the simulator it does not appear anymore.
I also tried to use a Scaled Label and defined the icon as FinishFlag (which was present in the res file), and again it appeared in the GUI Builder but not in the simulator. Of course there is no error printed in the console telling me the file could not be found.
Please note: the res/myCustomTheme.css folder holds all the subfolders related to the png (and those subfolders are populated with low to hd pngs) and the src/theme.res has the pictures (folowing Shai's advice) :
So what should I do to make the picture appear in the simulator ?
Edit : I tried to hand code the UI and added a Label (with the UIID defined above) to the the central area of a BorderLayout. I does not appear either until I add 3 spaces or more to the Label. I did not try again with the GUI Builder. It looks odd to me, is it done on purpose ?
Edit September 13th 2017 : If I build the app and open it on a real Android device then the labels appear.
Edit September 15th 2017 : For people having the issue of component not showing, as advised in the accepted answer the solution consists in removing top or bottom constraint of the component not showing and setting it to auto (click on the lock) so that there is enough space for the components. So eventually after setting to "auto" the bottom constraint of the progress bar an labels the expected result appear on the simulator :
Any help appreciated,
The images in your issue are a red herring. It looks like the problem is with your layout insets. Notice that none of your lower components are showing up in the simulator. The "progression" label, the three zeroes, etc...
I can't see the constraints you are using for the flags or the zeroes labels, but I can see that the "progression" label has fixed insets on both top and bottom. This may result in a zero height if there isn't enough space for it. Try changing either the top or bottom insets to "auto" so that they are flexible.
Try changing the simulator to use the desktop theme so that you can resize the window and see how the form looks at different sizes.
You can also easily verify this by overriding the layoutContainer() method of the form, and check the height that your flag label is getting:
public void layoutContainer() {
super.layoutContainer();
System.out.println("finishflag height: "+gui_FinishFlag.getHeight());
}
I'm not sure what's the "right" solution for this so maybe Steve can interject but this is what's happening.
You have two resource files: theme & theme.css.
The images in theme.css work great for your styles. However, since the loading process loads theme and not theme.css the simulator is unaware of these images as the theme res file doesn't know of them.
The GUI builder is probably scanning all the res files here so it lets you do that which might be a mistake... You have the following options to workaround this:
Load theme.css and discard theme - you will need to define the inheritNativeThemeBool flag and should no longer use the designer tool if you take that approach
Use the designer tool to load the images rather than CSS
Explicitly load the css res file using Resources.open and explicitly pass it to the Form
Explicitly load the css res file using Resources.open and set it as the global resource file
Right now I am using the default maps ui: http://js.api.here.com/v3/3.0/mapsjs-ui.css.
But I am not completely happy with the black controle buttons (mapsetting, zoom).
On js api start page here maps is using white buttons without round corners, exactly what I want.
Is there a secound css file I did not found or will it be replace current black style in near future?
It is not the problem to change style by my own, but I would prefer a other way.
There is only one CSS file with the black color scheme. My guess is, the developer.here.com color scheme is a custom override of the styles. But then again, the mapsjs-ui.css file uncompressed making your own color overrides relatively simple.
I agree that if they change CSS rules it's your issue. However, that doesn't seem to have happened, like... ever until now.
I haven't been able to find an answer to this online. Is there a way to use 9-slice scaling with images loaded at runtime?
To clarify, let's say that I build an application that lets a user skin a button with whatever image they want. This would be an image that's not embedded with the swf. Is there a way to set that runtime image as a background and use 9-scaling?
Thanks!
You can specify a rectangle as the scale9grid of a movieClip that contains your image art.
http://www.sephiroth.it/tutorials/flashPHP/scale9/
Now, to use a MovieClip in Flex (it's a Flash thingy) you have to load it into a UIComponent:
http://cookbooks.adobe.com/post_You_wish_to_add_a_Sprite_or_MovieClip_to_a_Flex_ap-7142.html
I have a weird problem with images in visual web developer,
I cant change my images properties from properties panel (my changes don't take effect) and all images in my website have gotten the same size
when I resize one image (by dragging the border), all images get that new size?
any idea?
Somehow visual web developer read the image class in the CSS file instead of the properties of the control because there is something like this in my CSS file:
img {
width:260px;
}
Yes, basically the width and height properties of the HTML <img /> have been deprecated for some time, you are recommended to use styles instead.
VS then takes this to the extreme, and instead of using inline styles, will create a new style in the default style sheet location for img, as you've discovered.
However, unless you are using the image full size somewhere you are better off resizing the image before you upload it to the server, saving on everyones bandwidth.
Also, IE does pretty poor things with it's default scaling routine, but you can turn on cubic sampling through css.