How can I change the color of the SelectBox selected text font? The below code renders it white even though I set it orange.
SelectBox.SelectBoxStyle sbs = new SelectBox.SelectBoxStyle();
sbs.background = new TextureRegionDrawable(skin.getRegion("regionsbox"));
sbs.listStyle = listS;
sbs.font = skin.getFont("fontno1");
sbs.fontColor = Color.ORANGE;
selectBox = new SelectBox<String>(sbs);
Ok guys this has taken me two days and apparently the problem could have been solved easily by some lateral-thinking wizard. Libgdx version 1.5.6 is somehow broken and does not render fonts inside SelectBox correctly. I updated the project to Libgdx 1.6.0 (latest version) and now my code works as expected .
Hope this will help other people with the same problem!
Related
I recently discovered a strange behaviour using the autodesk forge viewer.
While viewing a model, i executed following code to add a red cube into my scene:
const mat = new THREE.MeshBasicMaterial({color: 0xff0000});
const geom = new THREE.BoxGeometry(50,50,50);
const cube = new THREE.Mesh(geom, mat);
NOP_VIEWER.impl.createOverlayScene('testOverlay', mat, mat);
NOP_VIEWER.impl.addOverlay('testOverlay', cube);
Regularly, the result would look as intended like this:
Adding a colored cube as intended
However, in the application I'm working in, the option setDisplayEdges is set to true as standard.
This seems to have the effect that any custom material used within the viewer is displayed as white, as seen in this example:
The same cube turned white without any change to the code itself
I was able to reproduce this in multiple models.
Glad to report that this has been fixed with the latest version 7.18
After upgrading to iOS 13, several tab bar related issues have appeared. I have fixed most, but the remaining one is being unable to overrride the tabbar's shadowimage. The following code worked in iOS 12 and lower:
[[UITabBar appearance] setShadowImage:[UIImage imageName:#"CustomTabBarShadowImage"]];
I tried to override it by setting the new "standardAppearance" attributes. That does work, but I use a custom font in my app and no matter what I do, the tabbaritem titles seem to be limited to the tab icon width and therefore cut off.
That leaves 2 questions please:
Any ideas how to get a custom tabbar shadowimage in iOS 13 without using standardAppearance?
How to prevent tabbaritem titles being cut-off when using a custom font? (Note that I set them using the new UITabBarItemStateAppearance methods)
PS: As to number 1, I have found a hack to work around it - I simply add a uiview with frame CGRectMake(0, -0.5, [UIScreen mainScreen].bounds.size.width, 0.5) to the tab bar- ugly but it works.
I am trying to find out if it is possible to change the font color in the status bar of a WindowedApplication without having to make a custom skin. The problem is that I am using the graphite theme which is pretty dark and when I add text to the status bar it is a very dark gray color that is hardly readable. I should note that I am using flash builder 4.6 and Flex 4.6. I have tried changing the colors of the theme inside the design editor but none of these changed the font color.
The text will be generated with actionscript. I noticed that there is also a statusBar variable that is an IVisualElement but I can't seem to find any documentation on this.This is how I am currently writing to the status bar.
this.status = "Testing";
Thank you for any information you can send my way.
Try with this
this.statusText.text = "Testing";
this.statusText.setStyle("color",0xFF0000);
I'm trying to change the background color of a live tiles on my Windows 8 application at runtime. Is this possible? Does anybody have a code snippet?
Background color is specified in app manifest. Thus it does not seems to be possible.
The same can be emulated by sending custom time at runtime with appropriate background image (for a color). This is quirky way, but my little mind can think of this approach only.
Suppose you have already fixed the problem but I will post this info here, might be useful if someone come accross this thread.
For Primary Tile the answer from Bruno Lemos is correct.
For Seconday Tiles I would use TileUpdateManager.CreateTileUpdaterForSecondaryTile(Tile2_ID).
Using TileNotifications and TileUpdaterManager works instantly to me.
Using the Tile templates you will have to modify some XML code from the template, but you could also download NotificationsExtensions NuGet package and do it this way:
var tile2 = TileContentFactory.CreateTileSquare150x150PeekImageAndText01();
tile2.Branding = TileBranding.Name;
tile2.Image.Src = "ms-appx:///assets/Logo-transparent.png"; //Useful to have the same logo image with transparent background and other colors
tile2.TextHeading.Text = "Heading";
tile2.TextBody1.Text = "String1";
tile2.TextBody2.Text = "String2";
tile2.TextBody3.Text = "String3";
var doc = new XmlDocument();
doc.LoadXml(tile2.ToString());
var updater = TileUpdateManager.CreateTileUpdaterForSecondaryTile(tile2_id);
updater.EnableNotificationQueueForSquare150x150(true); //enables up to 5 different tile *animations* for 150 square icon, can be enabled for other sizes too
updater.Update(new TileNotification(doc) { Tag = "1" });
The code above takes into account the SecondaryTile has been created previously.
You can see the different templates for icons here: https://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.ui.notifications.tiletemplatetype.aspx
You only have to change the line TileContentFactory.CreateNAMEOFTEMPLATE and fill the different string/image fields.
Info about EnableNotificationQueue to have more than 1 animation in the tile can be found here: https://msdn.microsoft.com/en-us/library/windows/apps/hh781199.aspx
For Primary / Default Tile, you can do what #Tilak said: create tile images notifications and use TileUpdateManager.CreateTileUpdaterForApplication().Update to update it.
For Secondary Tiles, do the following:
In the app manifest, set the background color to "transparent"
In the app manifest, use images with transparent background
Now you can do that at runtime:
var tile = new SecondaryTile("YOUR_TILE_ID");
tile.VisualElements.BackgroundColor = Colors.Red;
await tile.UpdateAsync();
The problem is: The background is not updating immediately and I don't
know why. But you can see the effect after sign out / sign in, for
example. (tested using windows 10)
So this answer is incomplete, but hopefully can give insights to people coming here from google, like me.
#brunolemos
I'm trying to insert some images in the jLabel on SWING. I'm using Netbeans 7.0.1 and using the visual drag and drop tool. When trying to insert image, I got some troubles. I read the tutorial on netbeans.org but jLabel > icon property doesn't match with my 7.0.1.
Do you have same problems as I faced? Please help on this problem.
[I could not post image for my low reputation]
This is how I resolved that problem:
ImageIcon img = new ImageIcon(getClass().getResource("/com/yourPackage/resources/img.jpg"));
myLabel.setIcon(img);
It worked fine whit static images as well as GIF's..
Hope this helps!