I have an app that's design for the black theme, Is it possible to force the black theme on the particular app.
Could I set the default font in my pages to be of a certain size and color?
Yes you can force it, but it won't pass the certification. Your app should be able work with black and white theme. Try to make your app "theme aware", use StaticResource like PhoneAccentColor. Use this code to detect the theme:
public bool LightThemeEnabled
{
get
{
return (Visibility)Application.Current.Resources["PhoneLightThemeVisibility"] == Visibility.Visible;
}
}
Ref
Related
Situation
I am currently exploring android development on xamarin and therefor decided to develop a small game.
Within the game, I have an ImageButton to access some menus. For instance the level up screen.
I made some low res image for the image button:
Issue
Now, if I use this in the image button, the image gets scaled up and therefore looks Blurry:
I guess, the reason being is bi-linear image sizing.
The proper implementation for my specific case would be sizing with nearest neighbor, as it preserves the low pixel look:
Question
How would I go about changing this? I have found code for WPF winforms but realized that xamarin has different calls...
class ImageButtonWithHardEdgeExpansion : SomeControl
{
public InterpolationMode InterpolationMode { get; set; }
protected override void OnPaint(PaintEventArgs paintEventArgs)
{
paintEventArgs.Graphics.InterpolationMode = InterpolationMode;
base.OnPaint(paintEventArgs);
}
}
For an intermediate workaround, I can use an external image resizer and store the image in high res... but that defies the purpose for me a little. so I am looking for a more long term solution.
You can use the padding to do this.
Before padding:
After padding:
I am using react navigation's theme functionality to switch between dark and light mode and getting the colors for the mode with const { colors } = useTheme(); However I am trying to set colors in a stylesheet. How should I go about doing this. I have been doing {[styles.subtitle, colors.text]} to set styles on components. Is there a cleaner way to do this? Such as setting the color inside the styles.subtitle object?
Make your stylesheet in the body of your component. Define const { colors } = useTheme(); and then directly beneath that (instead of at the bottom of the file), create your stylesheet
I recently discovered mermaid.js which is great to design graphs and Gantts.
I'm using the live editor (https://mermaid-js.github.io/mermaid-live-editor/) and it's quite easy.
But how can I simply change the text font and its size, colors of the tasks in the editor ?
I've read that it's possible to do this changing css attributes, but that's not clear for me, I would need some more explanations.
Many thanks
To change the border and background color of the nodes, text font and size for flowcharts, in "Mermaid configuration" panel, set the following code:
{
"theme": "default",
"themeVariables": {
"nodeBorder" : "#004990",
"mainBkg" : "#c9d7e4",
"nodeTextColor" : "#274059",
"fontFamily": "arial",
"fontSize": "18px"
}
}
For other changes, see the mermaid theming ref page:
https://mermaid-js.github.io/mermaid/#/theming
For styling Gantt charts see the Mermaid Documentation. However, since this method requires you to use a stylesheet I dont think that you can use it in the live editor.
More information on working with themes in general: Documentation
Have been searching through here with no luck, Pretty simple problem, On my emulator all font colors are white (which is what I want).
Testing on a device the fonts are all black now, I have managed to change this by setting the foreground colors on the elements however I am unable to do so on the longlistselector through code.
This works for me:
longListSelector.Background = new SolidColorBrush(Colors.Transparent);
However this has no effect:
longListSelector.Foreground = new SolidColorBrush(Colors.White);
Any other way I can attempt to set the text color on the longlistselector?
The reason foreground colors would be different would be because of the default style. PhoneAccentBrush changes based on if your "phone" is set to have a white background or a black one.
The reason why your longListSelector.Foreground is not working may be because the phoneaccentbrush is set on the items inside the longlistselector from a style?
How can I decrease the font size of the showAlertDialog title?
A (dirty) way is to overwrite the .dialog-title class of the palm css file. But this affects all alert dialogs of your app.
.dialog-title {
font-size:5px !important;
}
A better way is to use your one dialog template with:
this.controller.showDialog({
template: 'dialogs/sample-dialog',
assistant: new SampleDialogAssistant(this),
wisdom: randomLorem(),
preventCancel:true
});
See Palm Developer Guide for more information.