I was having a problem rendering text in a TabNavigator with a transparent TabBar, because I wanted to show the background Image. That image was mostly red, and I wanted pure white text for the labels, but they were coming out pink. The problem was that RN was blending then background colour with the text colour. Essentially, RN was not giving the text view 100% opacity.
To fix this, I added
backgroundColor: '#ffffff00',
opacity:100
to tabStylein tabBarOptions.
Related
I'm currently working on a project that basically shows a map. The map, image below, has different color gradients and I'd like to replicate the effect of vscode when you set color in css and it shows a little box that displays the color. I'd display that color and write a comment beside it.(I.E green = Great economy, light green = medium economy, and very light green = poor economy).
I'd really like to replicate the color display you see in vscode when you set color properties in css like this:
Open up settings in vs code (on a Mac, press command+comma)
Search for Color Decorators and check the box
More on vs code settings https://code.visualstudio.com/docs/getstarted/settings
I think you are asking about setting custom properties/variables in your CSS?
:root {
--some-yellow-you-name-here: #ffff00;
}
.you-class-name {
background-color: var(--some-yellow-you-name-here);
}
I want to display a disabled-but-giving-feedback button like in this answer using a block icon from material icons. It works, however, it'd look much better when the icon was bolder.
Can I make an imported icon look bolder? I guess, modifying the pen width in the SVG would do, but don't know how to do it (especially, whether it's possible "from the outside").
You need to set stroke and stroke-width CSS property on SVG element holding that icon.
For example:
stroke: black;
stroke-width: 2;
makes your icon black, and two times the line width.
My CN1 app features a FloatingActionButton. I need to change its background color. My styles are all defined in CSS. So this one is :
FAB {
background-color: #80ccc4;
}
And if I create the FAB like FloatingActionButton.createFAB(FontImage.MATERIAL_POWER_SETTINGS_NEW, "FAB"); it results in a FloatingActionButton with an added "hyphen" on top of it :
On the contrary if I create the FAB without providing a style and then programmatically set the background color like fab.getAllStyles().setBgColor(0x80ccc4); then I get the expected FAB :
So what should I set in the css file to remove this unwanted "hyphen" ?
Any help appreciated!
You are styling FAB and not FloatingActionButton which is the right UIID for that. If you used setUIID that might be problematic on a FAB as the content is set later.
The reason this is happening is a bit of a problem with CSS. We get the background color of the FAB from the RoundBorder but transparency should be 0 for the icon in the center.
Unfortunately in CSS you can't express both a background color and 0 background transparency. I don't think this is solvable in the CSS so I'll add a special case to the FloatingActionButton that should workaround this.
I am trying to add transparent background in my ionic letter-avatar,
but when letter avatar renders it is coming with default color background,
Here is my code:-
// avatar library
<script src="lib/ionic-letteravatar-master/ionic-letteravatar.js"></script>
<ionic-letter-avatar data="{{loginUser.name}}" shape="round" avatarborder="true"></ionic-letter-avatar>
assuming:- loginUser.name = Peter
Output is coming in round shape with text P with some default color.
My question is how to set ionic-letter-avatar with transparent background having solid:black border.
So that letter P will come with
round shape
custom border with black color
background transparent
Edit :-
we can add avatarcustomborder for customize the border
avatarcustomborder="border:5px solid black"
The problem is only, how to make background transparent.
I just started building my first App with Codename One and I'm having quite some trouble. :-)
I cant change the background color of a TextField, I changed everything in the Theme and named it "TextField". At the Color tab I changed the background color and set Transparency to 255. Since the Component is named TextField, shouldnt the style be applied automatically when I make a new TextField?
I also tried to set the UIID manually to "TextField", which didn't help either.
Am I missing something?
Kind regards,
Max
The way backgrounds work in Codename One is this:
Border is applied first
Then image
Then gradient
Then color
TextField and other components such as Button etc. often have a default border derived from the theme.
Switch to the Border tab, click derive then click the ... button and select empty.